yashmayya commented on code in PR #18729:
URL: https://github.com/apache/pinot/pull/18729#discussion_r3428871905
##########
pinot-query-planner/src/main/java/org/apache/pinot/query/planner/logical/RexExpressionUtils.java:
##########
@@ -350,20 +351,22 @@ private static RexExpression handleSearch(RexCall
rexCall) {
if (leftOperand instanceof RexLiteral) {
return evaluateLiteralIn((RexLiteral) leftOperand,
sarg.rangeSet.asRanges());
Review Comment:
I mean the left operand being a `NULL` literal: in that case
`evaluateLiteralIn`/`NotIn`/`OrRanges` ignore `nullAs` (e.g. `SEARCH(NULL,
Sarg[…; NULL AS TRUE])` folds to `FALSE` instead of `TRUE`, and
`evaluateLiteralOrRanges` actually NPEs on `range.contains(null)`).
`addNullCheckIfRequired` won't help here since these literal branches return
before reaching it - the guard needs to go inside the three `evaluateLiteral*`
methods: `if leftOperand.isNull()`, return `TRUE`/`FALSE`/`null` based on
`nullAs`. It's an edge case (Calcite usually constant-folds these away), so
fine to keep it small.
--
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]