(makeIter, makeNilIter makeIterFn, spanIterator parquetquery.Iterator, conditions []traceql.Condition, allConditions, selectAll bool)
| 2317 | } |
| 2318 | |
| 2319 | func createInstrumentationIterator(makeIter, makeNilIter makeIterFn, spanIterator parquetquery.Iterator, conditions []traceql.Condition, allConditions, selectAll bool) (parquetquery.Iterator, error) { |
| 2320 | var ( |
| 2321 | iters = []parquetquery.Iterator{} |
| 2322 | genericConditions []traceql.Condition |
| 2323 | ) |
| 2324 | |
| 2325 | for _, cond := range conditions { |
| 2326 | // Intrinsics ? |
| 2327 | switch cond.Attribute.Intrinsic { |
| 2328 | case traceql.IntrinsicInstrumentationName: |
| 2329 | pred, err := createStringPredicate(cond.Op, cond.Operands) |
| 2330 | if err != nil { |
| 2331 | return nil, err |
| 2332 | } |
| 2333 | iters = append(iters, makeIter(columnPathInstrumentationName, pred, columnPathInstrumentationName)) |
| 2334 | continue |
| 2335 | |
| 2336 | case traceql.IntrinsicInstrumentationVersion: |
| 2337 | pred, err := createStringPredicate(cond.Op, cond.Operands) |
| 2338 | if err != nil { |
| 2339 | return nil, err |
| 2340 | } |
| 2341 | iters = append(iters, makeIter(columnPathInstrumentationVersion, pred, columnPathInstrumentationVersion)) |
| 2342 | continue |
| 2343 | } |
| 2344 | |
| 2345 | // check attr not exists |
| 2346 | if cond.Op == traceql.OpNotExists { |
| 2347 | // Generic attr doesn't exist |
| 2348 | pred := parquetquery.NewIncludeNilStringEqualPredicate([]byte(cond.Attribute.Name)) |
| 2349 | iters = append(iters, makeNilIter(columnPathInstrumentationAttrKey, pred, cond.Attribute.Name)) |
| 2350 | continue |
| 2351 | } |
| 2352 | |
| 2353 | // Else: generic attribute lookup |
| 2354 | genericConditions = append(genericConditions, cond) |
| 2355 | } |
| 2356 | |
| 2357 | if selectAll { |
| 2358 | for _, entry := range intrinsicColumnLookups { |
| 2359 | if entry.scope != intrinsicScopeInstrumentation { |
| 2360 | continue |
| 2361 | } |
| 2362 | iters = append(iters, makeIter(entry.columnPath, nil, entry.columnPath)) |
| 2363 | } |
| 2364 | } |
| 2365 | |
| 2366 | attrIter, err := createAttributeIterator(makeIter, genericConditions, DefinitionLevelInstrumentationScopeAttrs, |
| 2367 | columnPathInstrumentationAttrKey, columnPathInstrumentationAttrString, columnPathInstrumentationAttrInt, columnPathInstrumentationAttrDouble, columnPathInstrumentationAttrBool, allConditions, selectAll) |
| 2368 | if err != nil { |
| 2369 | return nil, fmt.Errorf("creating instrumentation attribute iterator: %w", err) |
| 2370 | } |
| 2371 | if attrIter != nil { |
| 2372 | iters = append(iters, attrIter) |
| 2373 | } |
| 2374 | |
| 2375 | minCount := 0 |
| 2376 | if allConditions { |
no test coverage detected