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

Function searchParquetFile

tempodb/encoding/vparquet4/block_search.go:259–284  ·  view source on GitHub ↗
(ctx context.Context, pf *parquet.File, req *tempopb.SearchRequest, rgs []parquet.RowGroup, dc backend.DedicatedColumns)

Source from the content-addressed store, hash-verified

257}
258
259func searchParquetFile(ctx context.Context, pf *parquet.File, req *tempopb.SearchRequest, rgs []parquet.RowGroup, dc backend.DedicatedColumns) (*tempopb.SearchResponse, error) {
260 // Search happens in 2 phases for an optimization.
261 // Phase 1 is iterate all columns involved in the request.
262 // Only if there are any matches do we enter phase 2, which
263 // is to load the display-related columns.
264
265 // Find matches
266 matchingRows, err := searchRaw(ctx, pf, req, rgs, dc)
267 if err != nil {
268 return nil, err
269 }
270 if len(matchingRows) == 0 {
271 return &tempopb.SearchResponse{Metrics: &tempopb.SearchMetrics{}}, nil
272 }
273
274 // We have some results, now load the display columns
275 results, err := rawToResults(ctx, pf, rgs, matchingRows)
276 if err != nil {
277 return nil, err
278 }
279
280 return &tempopb.SearchResponse{
281 Traces: results,
282 Metrics: &tempopb.SearchMetrics{},
283 }, nil
284}
285
286func searchRaw(ctx context.Context, pf *parquet.File, req *tempopb.SearchRequest, rgs []parquet.RowGroup, dc backend.DedicatedColumns) ([]pq.RowNumber, error) {
287 iter := makePipelineWithRowGroups(ctx, req, pf, rgs, dc)

Callers 2

SearchMethod · 0.70
SearchMethod · 0.70

Calls 2

searchRawFunction · 0.70
rawToResultsFunction · 0.70

Tested by

no test coverage detected