(ctx context.Context, pf *parquet.File, req *tempopb.SearchRequest, rgs []parquet.RowGroup, dc backend.DedicatedColumns)
| 275 | } |
| 276 | |
| 277 | func searchParquetFile(ctx context.Context, pf *parquet.File, req *tempopb.SearchRequest, rgs []parquet.RowGroup, dc backend.DedicatedColumns) (*tempopb.SearchResponse, error) { |
| 278 | // Search happens in 2 phases for an optimization. |
| 279 | // Phase 1 is iterate all columns involved in the request. |
| 280 | // Only if there are any matches do we enter phase 2, which |
| 281 | // is to load the display-related columns. |
| 282 | |
| 283 | // Find matches |
| 284 | matchingRows, err := searchRaw(ctx, pf, req, rgs, dc) |
| 285 | if err != nil { |
| 286 | return nil, err |
| 287 | } |
| 288 | if len(matchingRows) == 0 { |
| 289 | return &tempopb.SearchResponse{Metrics: &tempopb.SearchMetrics{}}, nil |
| 290 | } |
| 291 | |
| 292 | // We have some results, now load the display columns |
| 293 | results, err := rawToResults(ctx, pf, rgs, matchingRows) |
| 294 | if err != nil { |
| 295 | return nil, err |
| 296 | } |
| 297 | |
| 298 | return &tempopb.SearchResponse{ |
| 299 | Traces: results, |
| 300 | Metrics: &tempopb.SearchMetrics{}, |
| 301 | }, nil |
| 302 | } |
| 303 | |
| 304 | func searchRaw(ctx context.Context, pf *parquet.File, req *tempopb.SearchRequest, rgs []parquet.RowGroup, dc backend.DedicatedColumns) ([]pq.RowNumber, error) { |
| 305 | iter := makePipelineWithRowGroups(ctx, req, pf, rgs, dc) |
no test coverage detected