dario-liberman commented on code in PR #11092:
URL: https://github.com/apache/pinot/pull/11092#discussion_r1272710739


##########
pinot-core/src/main/java/org/apache/pinot/core/query/aggregation/function/FunnelCountAggregationFunction.java:
##########
@@ -198,27 +278,58 @@ private int[][] getSteps(Map<ExpressionContext, 
BlockValSet> blockValSetMap) {
   }
 
   private boolean isSorted(Map<ExpressionContext, BlockValSet> blockValSetMap) 
{
-    final Dictionary primaryCorrelationDictionary = 
blockValSetMap.get(_primaryCorrelationCol).getDictionary();
-    if (primaryCorrelationDictionary == null) {
-      throw new IllegalArgumentException(
-          "CORRELATE_BY column in FUNNELCOUNT aggregation function not 
supported, please use a dictionary encoded "
-              + "column.");
+    return getDictionary(blockValSetMap).isSorted();
+  }
+
+  private AggregationStrategy getAggregationStrategy(Map<ExpressionContext, 
BlockValSet> blockValSetMap) {
+    if (_partitionSetting && _sortingSetting && isSorted(blockValSetMap)) {
+      return _sortedAggregationStrategy;
+    }
+    if (_thetaSketchSetting) {
+      return _thetaSketchAggregationStrategy;
     }
-    return primaryCorrelationDictionary.isSorted();
+    // default
+    return _bitmapAggregationStrategy;
   }
 
-  private SegmentAggregationStrategy<?, List<Long>> 
getAggregationStrategyByBlockValSetMap(
-      Map<ExpressionContext, BlockValSet> blockValSetMap) {
-    return isSorted(blockValSetMap) ? _sortedAggregationStrategy : 
_bitmapAggregationStrategy;
+  private ResultExtractionStrategy getResultExtractionStrategy(Object 
aggResult) {
+    if (_partitionSetting) {
+        if (_sortingSetting && aggResult instanceof SortedAggregationResult) {
+          return _sortedPartitionedResultExtractionStrategy;
+        }
+        if (_thetaSketchSetting) {
+          return _thetaSketchPartitionedResultExtractionStrategy;
+        }
+        return _bitmapPartitionedResultExtractionStrategy;
+    }
+    if (_thetaSketchSetting) {
+      return _thetaSketchResultExtractionStrategy;

Review Comment:
   There are 5 tests included with this PR exercising for each strategy both 
aggregation only and aggregation with group-by:
   - FunnelCountQueriesBitmapTest
   - FunnelCountQueriesPartitionedSortedTest
   - FunnelCountQueriesPartitionedTest
   - FunnelCountQueriesSetTest
   - FunnelCountQueriesThetaSketchTest



-- 
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-unsubscr...@pinot.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org
For additional commands, e-mail: commits-h...@pinot.apache.org

Reply via email to