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/08/03 00:10:26 UTC

[GitHub] [pinot] shenyu0127 commented on a diff in pull request #11249: ExpressionFilterOperator IS NULL and IS NOT NULL support.

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


##########
pinot-core/src/main/java/org/apache/pinot/core/operator/dociditerators/ExpressionScanDocIdIterator.java:
##########
@@ -148,8 +149,18 @@ private void processProjectionBlock(ProjectionBlock projectionBlock, BitmapDataP
     TransformResultMetadata resultMetadata = _transformFunction.getResultMetadata();
     if (resultMetadata.isSingleValue()) {
       _numEntriesScanned += numDocs;
-      boolean predicateEvaluationResult = _predicateEvaluationResult == PredicateEvaluationResult.TRUE;
       RoaringBitmap nullBitmap = null;
+      if (_predicateEvaluationResult == PredicateEvaluationResult.NULL) {
+        nullBitmap = _transformFunction.getNullBitmap(projectionBlock);
+        if (nullBitmap != null) {
+          for (int i : nullBitmap) {
+           matchingDocIds.add(_docIdBuffer[i]);

Review Comment:
   Done.



##########
pinot-core/src/main/java/org/apache/pinot/core/operator/dociditerators/ExpressionScanDocIdIterator.java:
##########
@@ -315,6 +326,10 @@ private void processProjectionBlock(ProjectionBlock projectionBlock, BitmapDataP
       }
     } else {
       // TODO(https://github.com/apache/pinot/issues/10882): support NULL for multi-value.
+      if (_nullHandlingEnabled || _predicateEvaluationResult == PredicateEvaluationResult.NULL) {
+        throw new UnsupportedOperationException("NULL handling is not supported for multi-value");

Review Comment:
   Good point.
   
   Modified the code to not throw an exception when null handling is enabled, and to return empty matching document IDs when `_predicateEvaluationResult == PredicateEvaluationResult.NULL`. Also added unit tests for those two scenarios.



-- 
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