nizarhejazi commented on code in PR #8927:
URL: https://github.com/apache/pinot/pull/8927#discussion_r922583526


##########
pinot-core/src/main/java/org/apache/pinot/core/query/aggregation/groupby/NoDictionarySingleColumnGroupKeyGenerator.java:
##########
@@ -122,6 +137,88 @@ public void generateKeysForBlock(TransformBlock 
transformBlock, int[] groupKeys)
     }
   }
 
+  public void generateKeysForBlockNullHandlingEnabled(TransformBlock 
transformBlock, int[] groupKeys,
+      RoaringBitmap nullBitmap) {
+    assert nullBitmap != null;
+    BlockValSet blockValSet = 
transformBlock.getBlockValueSet(_groupByExpression);
+    int numDocs = transformBlock.getNumDocs();
+
+    switch (_storedType) {
+      case INT:
+        int[] intValues = blockValSet.getIntValuesSV();
+        if (nullBitmap.getCardinality() < numDocs) {
+          for (int i = 0; i < numDocs; i++) {
+            groupKeys[i] = nullBitmap.contains(i) ? getKeyForNullValue() : 
getKeyForValue(intValues[i]);
+          }
+        } else if (numDocs > 0) {
+          Arrays.fill(groupKeys, getKeyForNullValue());

Review Comment:
   you mean: `Arrays.fill(groupKeys, 0, numDocs, getKeyForNullValue());`



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