Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
ndk committed Nov 14, 2024
1 parent d730dfc commit 5b13f6e
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion tempodb/encoding/vparquet4/block_traceql.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 5b13f6e

Please sign in to comment.