diff --git a/tempodb/encoding/vparquet4/block_traceql.go b/tempodb/encoding/vparquet4/block_traceql.go index f67fc272e36..772cfb73063 100644 --- a/tempodb/encoding/vparquet4/block_traceql.go +++ b/tempodb/encoding/vparquet4/block_traceql.go @@ -1896,7 +1896,7 @@ func createSpanIterator(makeIter makeIterFn, innerIterators []parquetquery.Itera continue case traceql.IntrinsicDuration: - pred, err := createIntPredicate(cond.Op, cond.Operands) + pred, err := createNumericPredicate(cond.Op, cond.Operands) if err != nil { return nil, err } @@ -2496,6 +2496,19 @@ func createBytesPredicate(op traceql.Operator, operands traceql.Operands, isSpan } } +func createNumericPredicate(op traceql.Operator, operands traceql.Operands) (parquetquery.Predicate, error) { + if op == traceql.OpNone { + return nil, nil + } + + if operands[0].Type == traceql.TypeFloat { + // The column is already indexed as int, so we need to convert the float to int + operands = traceql.Operands{traceql.NewStaticInt(int(operands[0].Float()))} + } + + return createIntPredicate(op, operands) +} + func createIntPredicate(op traceql.Operator, operands traceql.Operands) (parquetquery.Predicate, error) { if op == traceql.OpNone { return nil, nil