MCPcopy
hub / github.com/grafana/tempo / createDurationPredicate

Function createDurationPredicate

tempodb/encoding/vparquet5/block_traceql.go:2810–2825  ·  view source on GitHub ↗
(op traceql.Operator, operands traceql.Operands)

Source from the content-addressed store, hash-verified

2808}
2809
2810func 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

Callers 4

createSpanIteratorFunction · 0.70
createTraceIteratorFunction · 0.70
createSpanIteratorsFunction · 0.70

Calls 3

createExistencePredicateFunction · 0.70
createIntPredicateFunction · 0.70

Tested by 1