(makeIter, makeNilIter makeIterFn, conditions []traceql.Condition, allConditions, selectAll bool)
| 860 | } |
| 861 | |
| 862 | func createLinkIterators(makeIter, makeNilIter makeIterFn, conditions []traceql.Condition, allConditions, selectAll bool) (required, optional []parquetquery.Iterator, err error) { |
| 863 | // TODO - Preserving compatibility with original fetch. |
| 864 | // If there are no event-level conditions we do nothing. |
| 865 | // Which means we are ignoring event data during select all. |
| 866 | if len(conditions) == 0 { |
| 867 | return nil, nil, nil |
| 868 | } |
| 869 | var genericConditions []traceql.Condition |
| 870 | |
| 871 | for _, cond := range conditions { |
| 872 | switch cond.Attribute.Intrinsic { |
| 873 | case traceql.IntrinsicLinkTraceID: |
| 874 | pred, err := createBytesPredicate(cond.Op, cond.Operands, false) |
| 875 | if err != nil { |
| 876 | return nil, nil, err |
| 877 | } |
| 878 | optional = append(optional, makeIter(columnPathLinkTraceID, pred, columnPathLinkTraceID)) |
| 879 | continue |
| 880 | |
| 881 | case traceql.IntrinsicLinkSpanID: |
| 882 | pred, err := createBytesPredicate(cond.Op, cond.Operands, true) |
| 883 | if err != nil { |
| 884 | return nil, nil, err |
| 885 | } |
| 886 | optional = append(optional, makeIter(columnPathLinkSpanID, pred, columnPathLinkSpanID)) |
| 887 | continue |
| 888 | } |
| 889 | |
| 890 | if cond.Op == traceql.OpNotExists { |
| 891 | // Generic attr doesn't exist |
| 892 | pred := parquetquery.NewIncludeNilStringEqualPredicate([]byte(cond.Attribute.Name)) |
| 893 | optional = append(optional, makeNilIter(columnPathLinkAttrKey, pred, cond.Attribute.Name)) |
| 894 | continue |
| 895 | } |
| 896 | |
| 897 | genericConditions = append(genericConditions, cond) |
| 898 | } |
| 899 | |
| 900 | attrIter, err := createScopedAttributeIterator( |
| 901 | makeIter, genericConditions, DefinitionLevelResourceSpansILSSpanLinkAttrs, |
| 902 | columnPathLinkAttrKey, |
| 903 | columnPathLinkAttrString, |
| 904 | columnPathLinkAttrInt, |
| 905 | columnPathLinkAttrDouble, |
| 906 | columnPathLinkAttrBool, |
| 907 | allConditions, |
| 908 | selectAll, |
| 909 | traceql.AttributeScopeLink) |
| 910 | if err != nil { |
| 911 | return nil, nil, fmt.Errorf("creating link attribute iterator: %w", err) |
| 912 | } |
| 913 | |
| 914 | if attrIter != nil { |
| 915 | optional = append(optional, attrIter) |
| 916 | } |
| 917 | |
| 918 | if allConditions { |
| 919 | required = append(required, optional...) |
no test coverage detected