icefury71 commented on a change in pull request #4943: Adding basic null 
predicate support
URL: https://github.com/apache/incubator-pinot/pull/4943#discussion_r360560846
 
 

 ##########
 File path: 
pinot-core/src/main/java/org/apache/pinot/core/plan/FilterPlanNode.java
 ##########
 @@ -111,6 +113,15 @@ private static BaseFilterOperator 
constructPhysicalOperator(FilterQueryTree filt
       // Leaf filter operator
       Predicate predicate = Predicate.newPredicate(filterQueryTree);
 
+      // Check for null predicate
+      Predicate.Type type = predicate.getType();
+      if (type.equals(Predicate.Type.IS_NULL) || 
type.equals(Predicate.Type.IS_NOT_NULL)) {
+        DataSource dataSource = 
segment.getDataSource(filterQueryTree.getColumn());
+        ImmutableRoaringBitmap nullBitmap = 
dataSource.getNullValueVector().getNullBitmap();
+        boolean exclusive = (type == Predicate.Type.IS_NULL) ? false : true;
+        return new BitmapBasedFilterOperator(new 
ImmutableRoaringBitmap[]{nullBitmap}, 0, numDocs-1, exclusive);
 
 Review comment:
   Tried reformatting - doesn't seem to affect this. 

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to