(makeIter, makeNilIter makeIterFn, // driver is iterator 0, and defines the rows for the LeftJoinIterator and Collector. Collector.Reset() // is called once for each row returned by the driver. Because we want spans, this is always something at the // the span level, like StartTimeUnixNanos for metrics, or the virtual row number iterator for other cases. driver parquetquery.Iterator, conditions []traceql.Condition, secondPass traceql.SecondPassFn, start, end uint64, allConditions bool, selectAll bool, dedicatedColumns backend.DedicatedColumns, sampler traceql.Sampler, )
| 71 | } |
| 72 | |
| 73 | func create(makeIter, makeNilIter makeIterFn, |
| 74 | // driver is iterator 0, and defines the rows for the LeftJoinIterator and Collector. Collector.Reset() |
| 75 | // is called once for each row returned by the driver. Because we want spans, this is always something at the |
| 76 | // the span level, like StartTimeUnixNanos for metrics, or the virtual row number iterator for other cases. |
| 77 | driver parquetquery.Iterator, |
| 78 | conditions []traceql.Condition, |
| 79 | secondPass traceql.SecondPassFn, |
| 80 | start, end uint64, |
| 81 | allConditions bool, |
| 82 | selectAll bool, |
| 83 | dedicatedColumns backend.DedicatedColumns, |
| 84 | sampler traceql.Sampler, |
| 85 | ) (parquetquery.Iterator, *span, error) { |
| 86 | catConditions, mingledConditions, err := categorizeConditions(conditions) |
| 87 | if err != nil { |
| 88 | return nil, nil, err |
| 89 | } |
| 90 | |
| 91 | // Optimization for queries like {resource.x... && span.y ...} |
| 92 | // Requires no mingled scopes like .foo=x, which could be satisfied |
| 93 | // by either resource or span. |
| 94 | allConditions = allConditions && !mingledConditions |
| 95 | |
| 96 | // Don't return the final spanset upstream unless it matched at least 1 condition |
| 97 | // anywhere, except in the case of the empty query: {} |
| 98 | batchRequireAtLeastOneMatchOverall := len(conditions) > 0 && len(catConditions.trace) == 0 |
| 99 | |
| 100 | traceIters, traceOptional := createTraceIterators(makeIter, catConditions.trace, start, end, allConditions, dedicatedColumns, selectAll) |
| 101 | |
| 102 | resIters, resOptional, err := createResourceIterators(makeIter, makeNilIter, catConditions.resource, allConditions, dedicatedColumns, selectAll) |
| 103 | if err != nil { |
| 104 | return nil, nil, err |
| 105 | } |
| 106 | |
| 107 | alternateDriver, spanIters, spanOptional, err := createSpanIterators(makeIter, makeNilIter, driver == nil, catConditions.span, allConditions, selectAll, dedicatedColumns, sampler) |
| 108 | if err != nil { |
| 109 | return nil, nil, err |
| 110 | } |
| 111 | |
| 112 | eventIters, eventOptional, err := createEventIterators(makeIter, makeNilIter, catConditions.event, allConditions, dedicatedColumns, selectAll) |
| 113 | if err != nil { |
| 114 | return nil, nil, err |
| 115 | } |
| 116 | |
| 117 | linkIters, linkOptional, err := createLinkIterators(makeIter, makeNilIter, catConditions.link, allConditions, selectAll) |
| 118 | if err != nil { |
| 119 | return nil, nil, err |
| 120 | } |
| 121 | |
| 122 | instIters, instOptional, err := createInstrumentationIterators(makeIter, makeNilIter, catConditions.instrumentation, allConditions, selectAll) |
| 123 | if err != nil { |
| 124 | return nil, nil, err |
| 125 | } |
| 126 | |
| 127 | debugName := "firstPass" |
| 128 | if selectAll { |
| 129 | debugName = "secondPass" |
| 130 | } |
no test coverage detected