clintropolis commented on code in PR #19356:
URL: https://github.com/apache/druid/pull/19356#discussion_r3115406277


##########
server/src/main/java/org/apache/druid/segment/realtime/appenderator/SinkQuerySegmentWalker.java:
##########
@@ -535,9 +535,13 @@ public void after(boolean isDone, Throwable thrown)
                 }
               } else {
                 final QueryMetrics<?> queryMetrics = 
queryWithMetrics.getQueryMetrics();
+                final Query<?> query = queryWithMetrics.getQuery();
                 // report accumulated metrics
                 for (Map.Entry<String, SegmentMetrics> segmentAndMetrics : 
segmentMetricsAccumulator.entrySet()) {
                   queryMetrics.segment(segmentAndMetrics.getKey());
+                  // Raw cast is safe: queryType() only calls query.getType(), 
defined on base Query interface.
+                  //noinspection rawtypes
+                  ((QueryMetrics) queryMetrics).queryType(query);

Review Comment:
   this is normally set by `QueryMetrics.query`, why is this needed too? Is 
that not getting called somewhere, or `query.getMetrics` having a metrics that 
doesn't have the query set?



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