gortiz commented on code in PR #17867:
URL: https://github.com/apache/pinot/pull/17867#discussion_r2954476402


##########
pinot-core/src/main/java/org/apache/pinot/core/operator/transform/function/JsonExtractScalarTransformFunction.java:
##########
@@ -120,6 +158,37 @@ public TransformResultMetadata getResultMetadata() {
     return _resultMetadata;
   }
 
+  @Override
+  public @Nullable RoaringBitmap getNullBitmap(ValueBlock valueBlock) {
+    if (!_defaultIsNull) {
+      return super.getNullBitmap(valueBlock);
+    }
+    RoaringBitmap bitmap = new RoaringBitmap();
+    for (TransformFunction arg : _arguments.subList(1, _arguments.size() - 1)) 
{
+      RoaringBitmap argBitmap = arg.getNullBitmap(valueBlock);
+      if (argBitmap != null) {
+        bitmap.or(argBitmap);
+      }
+    }
+    int numDocs = valueBlock.getNumDocs();
+    RoaringBitmap nullBitmap = new RoaringBitmap();
+    IntFunction<Object> resultExtractor = getResultExtractor(valueBlock);
+    for (int i = 0; i < numDocs; i++) {
+      Object result = null;
+      try {
+        result = resultExtractor.apply(i);
+      } catch (Exception ignored) {
+      }
+      if (result == null) {
+        nullBitmap.add(i);
+      }
+    }
+    if (!nullBitmap.isEmpty()) {
+      bitmap.or(nullBitmap);
+    }

Review Comment:
   Yes, I didn't find a better way to do that.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to