MCPcopy
hub / github.com/grafana/tempo / fetch

Function fetch

tempodb/encoding/vparquet5/block_traceql.go:1628–1644  ·  view source on GitHub ↗

fetch is the core logic for executing the given conditions against the parquet columns. The algorithm can be summarized as a hiearchy of iterators where we iterate related columns together and collect the results at each level into attributes, spans, and spansets. Each condition (.foo=bar) is pushe

(ctx context.Context, req traceql.FetchSpansRequest, pf *parquet.File, rowGroups []parquet.RowGroup, dc backend.DedicatedColumns)

Source from the content-addressed store, hash-verified

1626// V
1627
1628func fetch(ctx context.Context, req traceql.FetchSpansRequest, pf *parquet.File, rowGroups []parquet.RowGroup, dc backend.DedicatedColumns) (*spansetIterator, error) {
1629 iter, err := createAllIterator(ctx, nil, req.Conditions, req.AllConditions, req.StartTimeUnixNanos, req.EndTimeUnixNanos, rowGroups, pf, dc, false, req.TraceSampler, req.SpanSampler)
1630 if err != nil {
1631 return nil, fmt.Errorf("error creating iterator: %w", err)
1632 }
1633
1634 if req.SecondPass != nil {
1635 iter = newBridgeIterator(newRebatchIterator(iter), req.SecondPass)
1636
1637 iter, err = createAllIterator(ctx, iter, req.SecondPassConditions, false, 0, 0, rowGroups, pf, dc, req.SecondPassSelectAll, nil, nil)
1638 if err != nil {
1639 return nil, fmt.Errorf("error creating second pass iterator: %w", err)
1640 }
1641 }
1642
1643 return newSpansetIterator(newRebatchIterator(iter)), nil
1644}
1645
1646type categorizedConditions struct {
1647 span []traceql.Condition

Callers 2

FetchMethod · 0.70
FetchMethod · 0.70

Calls 4

createAllIteratorFunction · 0.70
newBridgeIteratorFunction · 0.70
newRebatchIteratorFunction · 0.70
newSpansetIteratorFunction · 0.70

Tested by

no test coverage detected