yashmayya commented on code in PR #18334:
URL: https://github.com/apache/pinot/pull/18334#discussion_r3700142377


##########
pinot-core/src/main/java/org/apache/pinot/core/plan/AggregationPlanNode.java:
##########
@@ -115,17 +115,38 @@ public Operator<AggregationResultsBlock> 
buildNonFilteredAggOperator() {
 
     boolean hasNullValues = _queryContext.isNullHandlingEnabled() && 
hasNullValues(aggregationFunctions);
     if (!hasNullValues) {
+      DataSource[] dataSources = new DataSource[aggregationFunctions.length];
+      for (int i = 0; i < aggregationFunctions.length; i++) {
+        List<?> inputExpressions = 
aggregationFunctions[i].getInputExpressions();
+        if (!inputExpressions.isEmpty()) {
+          String column = ((ExpressionContext) 
inputExpressions.get(0)).getIdentifier();
+          dataSources[i] = _indexSegment.getDataSource(column, 
_queryContext.getSchema());
+        }
+      }
+
       // Priority 2: Check if non-scan based aggregation is feasible
       if (filterOperator.isResultMatchingAll() && isFitForNonScanBasedPlan()) {
-        DataSource[] dataSources = new DataSource[aggregationFunctions.length];
+        return new NonScanBasedAggregationOperator(_queryContext, dataSources, 
numTotalDocs);

Review Comment:
   I think it's fine to retain it, the operator preserves `AGGREGATE_NO_SCAN` 
explain output and the zero scan `numDocsScanned`/`numEntriesScannedPostFilter` 
semantics (there's no projection operators unlike the partial case).



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