richardstartin commented on a change in pull request #8408:
URL: https://github.com/apache/pinot/pull/8408#discussion_r836686708



##########
File path: 
pinot-core/src/main/java/org/apache/pinot/core/operator/query/MetadataBasedAggregationOperator.java
##########
@@ -43,29 +45,45 @@
 
   private final AggregationFunction[] _aggregationFunctions;
   private final SegmentMetadata _segmentMetadata;
-  private final Map<String, DataSource> _dataSourceMap;
+  private final DataSource[] _dataSources;
 
   public MetadataBasedAggregationOperator(AggregationFunction[] 
aggregationFunctions, SegmentMetadata segmentMetadata,
-      Map<String, DataSource> dataSourceMap) {
+      DataSource[] dataSources) {
     _aggregationFunctions = aggregationFunctions;
     _segmentMetadata = segmentMetadata;
-
-    // Datasource is currently not used, but will start getting used as we add 
support for aggregation
-    // functions other than count(*).
-    _dataSourceMap = dataSourceMap;
+    _dataSources = dataSources;
   }
 
   @Override
   protected IntermediateResultsBlock getNextBlock() {
     int numAggregationFunctions = _aggregationFunctions.length;
     List<Object> aggregationResults = new ArrayList<>(numAggregationFunctions);
-    long numTotalDocs = _segmentMetadata.getTotalDocs();
-    for (AggregationFunction aggregationFunction : _aggregationFunctions) {
-      Preconditions.checkState(aggregationFunction.getType() == 
AggregationFunctionType.COUNT,
-          "Metadata based aggregation operator does not support function type: 
" + aggregationFunction.getType());
-      aggregationResults.add(numTotalDocs);
+    for (int i = 0; i < _aggregationFunctions.length; i++) {

Review comment:
       Fair enough, I missed the variable above.




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