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

Function fetchSpans

tempodb/encoding/vparquet5/block_traceql_fetch.go:33–47  ·  view source on GitHub ↗

fetchSpans is the core logic for span-only fetch, like fetch is for Fetch. Callers open the parquet file and pass row groups.

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

Source from the content-addressed store, hash-verified

31
32// fetchSpans is the core logic for span-only fetch, like fetch is for Fetch. Callers open the parquet file and pass row groups.
33func fetchSpans(ctx context.Context, req traceql.FetchSpansRequest, pf *parquet.File, rowGroups []parquet.RowGroup, dc backend.DedicatedColumns) (*spanOnlyIterator, error) {
34 makeIter := makeIterFunc(ctx, rowGroups, pf)
35 makeNilIter := makeNilIterFunc(ctx, rowGroups, pf)
36 iter, span, err := create(makeIter, makeNilIter, nil, req.Conditions, req.SecondPass, req.StartTimeUnixNanos, req.EndTimeUnixNanos, req.AllConditions, false, dc, req.SpanSampler)
37 if err != nil {
38 return nil, err
39 }
40 if len(req.SecondPassConditions) > 0 || req.SecondPassSelectAll {
41 iter, span, err = create(makeIter, makeNilIter, iter, req.SecondPassConditions, nil, 0, 0, false, req.SecondPassSelectAll, dc, nil)
42 if err != nil {
43 return nil, err
44 }
45 }
46 return &spanOnlyIterator{iter: iter, span: span}, nil
47}
48
49type spanOnlyIterator struct {
50 iter parquetquery.Iterator

Callers 2

FetchSpansMethod · 0.85
FetchSpansMethod · 0.85

Calls 3

createFunction · 0.85
makeIterFuncFunction · 0.70
makeNilIterFuncFunction · 0.70

Tested by

no test coverage detected