You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by GitBox <gi...@apache.org> on 2022/10/11 06:31:07 UTC

[GitHub] [pinot] Jackie-Jiang commented on a diff in pull request #9566: Handle the case when enableNullHandling is true and an aggregation function is used w/ a column that has an empty null bitmap

Jackie-Jiang commented on code in PR #9566:
URL: https://github.com/apache/pinot/pull/9566#discussion_r991859596


##########
pinot-core/src/main/java/org/apache/pinot/core/query/aggregation/function/AvgAggregationFunction.java:
##########
@@ -67,10 +67,11 @@ public void aggregate(int length, AggregationResultHolder aggregationResultHolde
     BlockValSet blockValSet = blockValSetMap.get(_expression);
     if (_nullHandlingEnabled) {
       RoaringBitmap nullBitmap = blockValSet.getNullBitmap();
-      if (nullBitmap != null && !nullBitmap.isEmpty()) {
-        aggregateNullHandlingEnabled(length, aggregationResultHolder, blockValSet, nullBitmap);
-        return;
+      if (nullBitmap == null) {

Review Comment:
   We shouldn't need to change it for AVG because we are already storing object instead of double



##########
pinot-core/src/main/java/org/apache/pinot/core/query/aggregation/function/MaxAggregationFunction.java:
##########
@@ -73,10 +73,11 @@ public void aggregate(int length, AggregationResultHolder aggregationResultHolde
     BlockValSet blockValSet = blockValSetMap.get(_expression);
     if (_nullHandlingEnabled) {
       RoaringBitmap nullBitmap = blockValSet.getNullBitmap();
-      if (nullBitmap != null && !nullBitmap.isEmpty()) {
-        aggregateNullHandlingEnabled(length, aggregationResultHolder, blockValSet, nullBitmap);
-        return;
+      if (nullBitmap == null) {

Review Comment:
   Ideally we still want to avoid the null bitmap check when it is `null` or empty for better performance. We can merge this fix for now, but let's add a TODO to track it. Same for other functions that uses double result holder



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