categorizeConditions conditions into span, resource, and trace level.
(conditions []traceql.Condition)
| 1396 | |
| 1397 | // categorizeConditions conditions into span, resource, and trace level. |
| 1398 | func categorizeConditions(conditions []traceql.Condition) (mingled bool, spanConditions, resourceConditions, traceConditions []traceql.Condition, err error) { |
| 1399 | for _, cond := range conditions { |
| 1400 | // If no-scoped intrinsic then assign default scope |
| 1401 | scope := cond.Attribute.Scope |
| 1402 | if cond.Attribute.Scope == traceql.AttributeScopeNone { |
| 1403 | if lookup, ok := intrinsicColumnLookups[cond.Attribute.Intrinsic]; ok { |
| 1404 | scope = lookup.scope |
| 1405 | } |
| 1406 | } |
| 1407 | |
| 1408 | switch scope { |
| 1409 | |
| 1410 | case traceql.AttributeScopeNone: |
| 1411 | mingled = true |
| 1412 | spanConditions = append(spanConditions, cond) |
| 1413 | resourceConditions = append(resourceConditions, cond) |
| 1414 | continue |
| 1415 | |
| 1416 | case traceql.AttributeScopeSpan, intrinsicScopeSpan: |
| 1417 | spanConditions = append(spanConditions, cond) |
| 1418 | continue |
| 1419 | |
| 1420 | case traceql.AttributeScopeResource: |
| 1421 | resourceConditions = append(resourceConditions, cond) |
| 1422 | continue |
| 1423 | |
| 1424 | case intrinsicScopeTrace: |
| 1425 | traceConditions = append(traceConditions, cond) |
| 1426 | continue |
| 1427 | |
| 1428 | default: |
| 1429 | return false, nil, nil, nil, fmt.Errorf("unsupported traceql scope: %s", cond.Attribute) |
| 1430 | } |
| 1431 | } |
| 1432 | return mingled, spanConditions, resourceConditions, traceConditions, nil |
| 1433 | } |
| 1434 | |
| 1435 | func createAllIterator(ctx context.Context, primaryIter parquetquery.Iterator, conds []traceql.Condition, allConditions bool, start, end uint64, |
| 1436 | rgs []parquet.RowGroup, pf *parquet.File, dc backend.DedicatedColumns, selectAll bool, |
no outgoing calls
no test coverage detected