| 2808 | } |
| 2809 | |
| 2810 | func createDurationPredicate(op traceql.Operator, operands traceql.Operands) (parquetquery.Predicate, error) { |
| 2811 | if pred, handled := createExistencePredicate(op); handled { |
| 2812 | return pred, nil |
| 2813 | } |
| 2814 | |
| 2815 | if len(operands) == 0 { |
| 2816 | return nil, fmt.Errorf("operands cannot be empty") |
| 2817 | } |
| 2818 | |
| 2819 | if operands[0].Type == traceql.TypeFloat || operands[0].Type == traceql.TypeFloatArray { |
| 2820 | // The column is already indexed as int, so we need to convert the float to int |
| 2821 | return createIntPredicateFromFloat(op, operands) |
| 2822 | } |
| 2823 | |
| 2824 | return createIntPredicate(op, operands) |
| 2825 | } |
| 2826 | |
| 2827 | // createIntPredicateFromFloat adapts a float-based query operand to an int column. |
| 2828 | // If the float is exactly representable as an int64 (e.g. 42.0), we compare the |