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/04/14 19:21:17 UTC

[GitHub] [pinot] shenyu0127 commented on a diff in pull request #10604: Support null in InTransformFunction and NotInTransformFunction.

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


##########
pinot-core/src/main/java/org/apache/pinot/core/operator/transform/function/InTransformFunction.java:
##########
@@ -365,11 +380,56 @@ public int[] transformToIntValuesSV(ValueBlock valueBlock) {
             }
           }
           break;
+        case UNKNOWN:
+          break;
         default:
           throw new IllegalStateException();
       }
     }
 
     return _intValuesSV;
   }
+

Review Comment:
   I suggest not to implement `transformToInValuesSVWithNull`.
   
   - Implementing something like [`BaseTransformFunction.transformToInValuesSVWithNull`](https://github.com/apache/pinot/blob/13a792f03f267bf53e36fc06340d43d8fc1d7af4/pinot-core/src/main/java/org/apache/pinot/core/operator/transform/function/BaseTransformFunction.java#L184) violates [DRY](https://en.wikipedia.org/wiki/Don%27t_repeat_yourself).
   - There wouldn't be much performance gain because `BaseTransformFunction.transformToInValuesSVWithNull` still gets int[] and bitmap separately.
   



##########
pinot-core/src/main/java/org/apache/pinot/core/operator/transform/function/InTransformFunction.java:
##########
@@ -365,11 +380,56 @@ public int[] transformToIntValuesSV(ValueBlock valueBlock) {
             }
           }
           break;
+        case UNKNOWN:
+          break;
         default:
           throw new IllegalStateException();
       }
     }
 
     return _intValuesSV;
   }
+
+  @Nullable
+  @Override
+  public RoaringBitmap getNullBitmap(ValueBlock valueBlock) {
+    int length = valueBlock.getNumDocs();
+    RoaringBitmap result = new RoaringBitmap();
+    RoaringBitmap mainFunctionNullBitmap = _mainFunction.getNullBitmap(valueBlock);
+    if (mainFunctionNullBitmap != null) {
+      result.or(mainFunctionNullBitmap);
+    }

Review Comment:
   Done.



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