categorizeConditions categorizes conditions by scope
(conditions []traceql.Condition)
| 1654 | |
| 1655 | // categorizeConditions categorizes conditions by scope |
| 1656 | func categorizeConditions(conditions []traceql.Condition) (*categorizedConditions, bool, error) { |
| 1657 | var mingled bool |
| 1658 | var categorizedCond categorizedConditions |
| 1659 | |
| 1660 | for _, cond := range conditions { |
| 1661 | // If no-scoped intrinsic then assign default scope |
| 1662 | scope := cond.Attribute.Scope |
| 1663 | if cond.Attribute.Scope == traceql.AttributeScopeNone { |
| 1664 | if lookup, ok := intrinsicColumnLookups[cond.Attribute.Intrinsic]; ok { |
| 1665 | scope = lookup.scope |
| 1666 | } |
| 1667 | } |
| 1668 | |
| 1669 | switch scope { |
| 1670 | |
| 1671 | case traceql.AttributeScopeNone: |
| 1672 | mingled = true |
| 1673 | categorizedCond.span = append(categorizedCond.span, cond) |
| 1674 | categorizedCond.resource = append(categorizedCond.resource, cond) |
| 1675 | |
| 1676 | case traceql.AttributeScopeSpan, intrinsicScopeSpan: |
| 1677 | categorizedCond.span = append(categorizedCond.span, cond) |
| 1678 | |
| 1679 | case traceql.AttributeScopeResource: |
| 1680 | categorizedCond.resource = append(categorizedCond.resource, cond) |
| 1681 | |
| 1682 | case traceql.AttributeScopeEvent, intrinsicScopeEvent: |
| 1683 | categorizedCond.event = append(categorizedCond.event, cond) |
| 1684 | |
| 1685 | case traceql.AttributeScopeLink, intrinsicScopeLink: |
| 1686 | categorizedCond.link = append(categorizedCond.link, cond) |
| 1687 | |
| 1688 | case intrinsicScopeTrace: |
| 1689 | categorizedCond.trace = append(categorizedCond.trace, cond) |
| 1690 | |
| 1691 | case traceql.AttributeScopeInstrumentation, intrinsicScopeInstrumentation: |
| 1692 | categorizedCond.instrumentation = append(categorizedCond.instrumentation, cond) |
| 1693 | |
| 1694 | default: |
| 1695 | return nil, false, fmt.Errorf("unsupported traceql scope: %s", cond.Attribute) |
| 1696 | } |
| 1697 | } |
| 1698 | return &categorizedCond, mingled, nil |
| 1699 | } |
| 1700 | |
| 1701 | func createAllIterator(ctx context.Context, primaryIter parquetquery.Iterator, conditions []traceql.Condition, allConditions bool, start, end uint64, rgs []parquet.RowGroup, |
| 1702 | pf *parquet.File, dc backend.DedicatedColumns, selectAll bool, |
no outgoing calls
no test coverage detected