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

Function createDurationPredicate

tempodb/encoding/vparquet4/block_traceql.go:2729–2744  ·  view source on GitHub ↗
(op traceql.Operator, operands traceql.Operands)

Source from the content-addressed store, hash-verified

2727}
2728
2729func 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

Callers 3

createSpanIteratorFunction · 0.70
createTraceIteratorFunction · 0.70

Calls 3

createExistencePredicateFunction · 0.70
createIntPredicateFunction · 0.70

Tested by 1