categorizeConditions categorizes conditions by scope
(conditions []traceql.Condition)
| 1626 | |
| 1627 | // categorizeConditions categorizes conditions by scope |
| 1628 | func categorizeConditions(conditions []traceql.Condition) (*categorizedConditions, bool, error) { |
| 1629 | var mingled bool |
| 1630 | var categorizedCond categorizedConditions |
| 1631 | |
| 1632 | for _, cond := range conditions { |
| 1633 | // If no-scoped intrinsic then assign default scope |
| 1634 | scope := cond.Attribute.Scope |
| 1635 | if cond.Attribute.Scope == traceql.AttributeScopeNone { |
| 1636 | if lookup, ok := intrinsicColumnLookups[cond.Attribute.Intrinsic]; ok { |
| 1637 | scope = lookup.scope |
| 1638 | } |
| 1639 | } |
| 1640 | |
| 1641 | switch scope { |
| 1642 | |
| 1643 | case traceql.AttributeScopeNone: |
| 1644 | mingled = true |
| 1645 | categorizedCond.span = append(categorizedCond.span, cond) |
| 1646 | categorizedCond.resource = append(categorizedCond.resource, cond) |
| 1647 | |
| 1648 | case traceql.AttributeScopeSpan, intrinsicScopeSpan: |
| 1649 | categorizedCond.span = append(categorizedCond.span, cond) |
| 1650 | |
| 1651 | case traceql.AttributeScopeResource: |
| 1652 | categorizedCond.resource = append(categorizedCond.resource, cond) |
| 1653 | |
| 1654 | case traceql.AttributeScopeEvent, intrinsicScopeEvent: |
| 1655 | categorizedCond.event = append(categorizedCond.event, cond) |
| 1656 | |
| 1657 | case traceql.AttributeScopeLink, intrinsicScopeLink: |
| 1658 | categorizedCond.link = append(categorizedCond.link, cond) |
| 1659 | |
| 1660 | case intrinsicScopeTrace: |
| 1661 | categorizedCond.trace = append(categorizedCond.trace, cond) |
| 1662 | |
| 1663 | case traceql.AttributeScopeInstrumentation, intrinsicScopeInstrumentation: |
| 1664 | categorizedCond.instrumentation = append(categorizedCond.instrumentation, cond) |
| 1665 | |
| 1666 | default: |
| 1667 | return nil, false, fmt.Errorf("unsupported traceql scope: %s", cond.Attribute) |
| 1668 | } |
| 1669 | } |
| 1670 | return &categorizedCond, mingled, nil |
| 1671 | } |
| 1672 | |
| 1673 | func createAllIterator(ctx context.Context, primaryIter parquetquery.Iterator, conditions []traceql.Condition, allConditions bool, start, end uint64, rgs []parquet.RowGroup, |
| 1674 | pf *parquet.File, dc backend.DedicatedColumns, selectAll bool, |
no outgoing calls
no test coverage detected