adasari commented on code in PR #18334:
URL: https://github.com/apache/pinot/pull/18334#discussion_r3694713633
##########
pinot-core/src/main/java/org/apache/pinot/core/operator/query/AggregationOperator.java:
##########
@@ -85,6 +118,28 @@ protected AggregationResultsBlock getNextBlock() {
return new AggregationResultsBlock(_aggregationFunctions,
aggregationExecutor.getResult(), _queryContext);
}
+ /**
+ * Returns {@code null} when no function is metadata-resolvable, in which
case all functions are computed by scanning.
+ * Each returned non-null entry is consumed by {@link
DefaultAggregationExecutor}, which skips the scan for that
+ * function and emits the resolved value directly.
+ */
+ @Nullable
+ private Object[] resolveMetadataBasedResults() {
+ if (_metadataResolvable == null) {
+ return null;
+ }
+
+ Objects.requireNonNull(_dataSources);
+ Object[] preAggregatedResults = new Object[_aggregationFunctions.length];
+ for (int i = 0; i < _aggregationFunctions.length; i++) {
+ if (_metadataResolvable[i]) {
+ preAggregatedResults[i] =
AggregationFunctionUtils.getAggregationResult(_aggregationFunctions[i],
+ _dataSources[i], (int) _numTotalDocs, EXPLAIN_NAME);
Review Comment:
Updated `_numTotalDocs` type to long here -
https://github.com/apache/pinot/blob/master/pinot-core/src/main/java/org/apache/pinot/core/operator/query/AggregationOperator.java#L53
--
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]