ilamhs commented on code in PR #18841:
URL: https://github.com/apache/pinot/pull/18841#discussion_r3475938305


##########
pinot-core/src/main/java/org/apache/pinot/core/query/aggregation/function/BaseDistinctCountSmartSketchAggregationFunction.java:
##########
@@ -508,16 +508,20 @@ public final Object 
extractAggregationResult(AggregationResultHolder aggregation
   }
 
   @Override
-  public final Set extractGroupByResult(GroupByResultHolder 
groupByResultHolder, int groupKey) {
+  public final Object extractGroupByResult(GroupByResultHolder 
groupByResultHolder, int groupKey) {
     Object result = groupByResultHolder.getResult(groupKey);
     if (result == null) {
       return EMPTY_PLACEHOLDER;
     }
 
-    if (result instanceof DictIdsWrapper) {
-      return convertToValueSet((DictIdsWrapper) result);
+    if (result instanceof DictIdsWrapper dictIdsWrapper) {
+      if (dictIdsWrapper._dictIdBitmap.cardinalityExceeds(getThreshold())) {
+        return convertToSketch(dictIdsWrapper);
+      } else {
+        return convertToValueSet(dictIdsWrapper);
+      }

Review Comment:
   Ah got it, yes. Updated now.



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