You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by "shenyu0127 (via GitHub)" <gi...@apache.org> on 2023/07/29 04:26:30 UTC

[GitHub] [pinot] shenyu0127 commented on a diff in pull request #11188: Fail the query if a filter's rhs contains NULL.

shenyu0127 commented on code in PR #11188:
URL: https://github.com/apache/pinot/pull/11188#discussion_r1278232062


##########
pinot-common/src/main/java/org/apache/pinot/sql/parsers/CalciteSqlParser.java:
##########
@@ -267,6 +270,35 @@ private static void validateDistinctQuery(PinotQuery pinotQuery)
     }
   }
 
+  /*
+   * Throws an exception if the filter's rhs has NULL because:
+   * - Predicate evaluator and pruning do not have NULL support.
+   * - It is not meaningful to have NULL in the filter's rhs.
+   *   - For most of the filters (e.g. GREATER_THAN, LIKE), the rhs being NULL leads to no record matched.
+   *   - For IN, adding NULL to the rhs list does not change the matched records.
+   *   - For NOT IN, adding NULL to the rhs list leads to no record matched.
+   *   - For "= NULL" and "!= NULL", we have the IS_NULL and IS_NOT_NULL as workarounds.

Review Comment:
   You are right. Corrected the function comment.



-- 
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: commits-unsubscribe@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org