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

[GitHub] [pinot] 61yao commented on a diff in pull request #10598: [feature] [null support # 9] Support null in time related transform functions.

61yao commented on code in PR #10598:
URL: https://github.com/apache/pinot/pull/10598#discussion_r1178578120


##########
pinot-core/src/main/java/org/apache/pinot/core/operator/transform/function/GreatestTransformFunction.java:
##########
@@ -44,6 +47,35 @@ public int[] transformToIntValuesSV(ValueBlock valueBlock) {
     return _intValuesSV;
   }
 
+  @Override
+  public Pair<int[], RoaringBitmap> transformToIntValuesSVWithNull(ValueBlock valueBlock) {
+    int numDocs = valueBlock.getNumDocs();
+    initIntValuesSV(numDocs);
+    Pair<int[], RoaringBitmap> values = _arguments.get(0).transformToIntValuesSVWithNull(valueBlock);
+    System.arraycopy(values.getLeft(), 0, _intValuesSV, 0, numDocs);
+    RoaringBitmap nullBitmap = values.getRight();
+    for (int i = 1; i < _arguments.size(); i++) {
+      values = _arguments.get(i).transformToIntValuesSVWithNull(valueBlock);
+      RoaringBitmap curNull = values.getRight();
+      for (int j = 0; j < numDocs & j < values.getLeft().length; j++) {
+        // Ignore null values.
+        if (curNull == null || !curNull.contains(j)) {
+          if (nullBitmap != null && nullBitmap.contains(j)) {

Review Comment:
   Oops.. This doesn't belong to this PR... 



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