walterddr commented on code in PR #10447:
URL: https://github.com/apache/pinot/pull/10447#discussion_r1161897968


##########
pinot-core/src/main/java/org/apache/pinot/core/query/reduce/ExecutionStatsAggregator.java:
##########
@@ -363,19 +362,19 @@ public void setStats(@Nullable String rawTableName, 
BrokerResponseNative brokerR
 
   public void setStageLevelStats(@Nullable String rawTableName, 
BrokerResponseStats brokerResponseStats,
       @Nullable BrokerMetrics brokerMetrics) {
-    setStats(rawTableName, brokerResponseStats, brokerMetrics);
+    if (_enableTrace) {
+      setStats(rawTableName, brokerResponseStats, brokerMetrics);
+      brokerResponseStats.setOperatorStats(_operatorStats);
+      brokerResponseStats.setTableNames(new ArrayList<>(_tableNames));

Review Comment:
   table name should be outside of enable trace right? 



##########
pinot-query-runtime/src/main/java/org/apache/pinot/query/service/dispatch/QueryDispatcher.java:
##########
@@ -221,12 +223,14 @@ private static List<DataBlock> 
reduceMailboxReceive(MailboxReceiveOperator mailb
             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());
-              OperatorUtils.recordTableName(operatorStats, 
operatorStageMetadata);
-            }
             rootStatsAggregator.aggregate(null, 
entry.getValue().getExecutionStats(), new HashMap<>());
-            stageStatsAggregator.aggregate(null, 
entry.getValue().getExecutionStats(), new HashMap<>());
+            if (stageStatsAggregator != null) {

Review Comment:
   why aren't these 2 null checker in place previously? was this captured by 
new tests added?



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