walterddr commented on code in PR #10337: URL: https://github.com/apache/pinot/pull/10337#discussion_r1119548603
########## pinot-query-runtime/src/main/java/org/apache/pinot/query/service/QueryDispatcher.java: ########## @@ -147,11 +149,22 @@ public static List<DataBlock> reduceMailboxReceive(MailboxReceiveOperator mailbo if (transferableBlock.isNoOpBlock()) { continue; } else if (transferableBlock.isEndOfStreamBlock()) { - if (executionStatsAggregator != null) { + if (executionStatsAggregatorMap != null) { for (Map.Entry<String, OperatorStats> entry : transferableBlock.getResultMetadata().entrySet()) { LOGGER.info("Broker Query Execution Stats - OperatorId: {}, OperatorStats: {}", entry.getKey(), OperatorUtils.operatorStatsToJson(entry.getValue())); - executionStatsAggregator.aggregate(null, entry.getValue().getExecutionStats(), new HashMap<>()); + OperatorStats operatorStats = entry.getValue(); + ExecutionStatsAggregator rootStatsAggregator = executionStatsAggregatorMap.get(0); + ExecutionStatsAggregator stageStatsAggregator = executionStatsAggregatorMap.get(operatorStats.getStageId()); + if (queryPlan != null) { + StageMetadata operatorStageMetadata = queryPlan.getStageMetadataMap().get(operatorStats.getStageId()); + if (!operatorStageMetadata.getScannedTables().isEmpty()) { + operatorStats.recordSingleStat(DataTable.MetadataKey.TABLE.getName(), + Joiner.on("::").join(operatorStageMetadata.getScannedTables())); + } + } Review Comment: follow up: refactor this part out as utils -- 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