| 2727 | } |
| 2728 | |
| 2729 | func createDurationPredicate(op traceql.Operator, operands traceql.Operands) (parquetquery.Predicate, error) { |
| 2730 | if pred, handled := createExistencePredicate(op); handled { |
| 2731 | return pred, nil |
| 2732 | } |
| 2733 | |
| 2734 | if len(operands) == 0 { |
| 2735 | return nil, fmt.Errorf("operands cannot be empty") |
| 2736 | } |
| 2737 | |
| 2738 | if operands[0].Type == traceql.TypeFloat || operands[0].Type == traceql.TypeFloatArray { |
| 2739 | // The column is already indexed as int, so we need to convert the float to int |
| 2740 | return createIntPredicateFromFloat(op, operands) |
| 2741 | } |
| 2742 | |
| 2743 | return createIntPredicate(op, operands) |
| 2744 | } |
| 2745 | |
| 2746 | // createIntPredicateFromFloat adapts a float-based query operand to an int column. |
| 2747 | // If the float is exactly representable as an int64 (e.g. 42.0), we compare the |