gortiz commented on code in PR #11512:
URL: https://github.com/apache/pinot/pull/11512#discussion_r1331073106
##########
pinot-query-planner/src/main/java/org/apache/pinot/query/planner/logical/RexExpressionUtils.java:
##########
@@ -155,10 +157,83 @@ private static RexExpression.FunctionCall
handleSearch(RexCall rexCall) {
return new RexExpression.FunctionCall(SqlKind.NOT_IN, dataType,
SqlKind.NOT_IN.name(),
toFunctionOperands(rexInputRef,
sarg.rangeSet.complement().asRanges(), dataType));
} else {
- throw new NotImplementedException("Range is not implemented yet");
+ Set<Range<?>> ranges = sarg.rangeSet.asRanges();
+ return convertRangesToOr(dataType, rexInputRef, ranges);
}
}
+ private static RexExpression convertRangesToOr(ColumnDataType dataType,
RexInputRef rexInputRef,
Review Comment:
Anyway, the issue we fixed here is that Calcite was creating an structure (a
range) we don´t actually support. With this PR we generate the expected
predicate (`field < xLiteral or field > yLiteral`) instead of the unsupported
range.
##########
pinot-query-planner/src/main/java/org/apache/pinot/query/planner/logical/RexExpressionUtils.java:
##########
@@ -155,10 +157,83 @@ private static RexExpression.FunctionCall
handleSearch(RexCall rexCall) {
return new RexExpression.FunctionCall(SqlKind.NOT_IN, dataType,
SqlKind.NOT_IN.name(),
toFunctionOperands(rexInputRef,
sarg.rangeSet.complement().asRanges(), dataType));
} else {
- throw new NotImplementedException("Range is not implemented yet");
+ Set<Range<?>> ranges = sarg.rangeSet.asRanges();
+ return convertRangesToOr(dataType, rexInputRef, ranges);
}
}
+ private static RexExpression convertRangesToOr(ColumnDataType dataType,
RexInputRef rexInputRef,
Review Comment:
Anyway, the issue we fixed here is that Calcite was creating an structure (a
range) we don´t actually support. With this PR we generate the expected
predicate (`field < xLiteral or field > yLiteral`) instead of the unsupported
range.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]