LakshSingla commented on code in PR #16703:
URL: https://github.com/apache/druid/pull/16703#discussion_r1680400092


##########
processing/src/main/java/org/apache/druid/query/groupby/GroupByQueryQueryToolChest.java:
##########
@@ -811,7 +811,11 @@ public Optional<Sequence<FrameSignaturePair>> 
resultsAsFrames(
       boolean useNestedForUnknownTypes
   )
   {
-    RowSignature rowSignature = resultArraySignature(query);
+    RowSignature rowSignature = query.getResultRowSignature(
+        query.context().isFinalize(true)
+        ? RowSignature.Finalization.YES
+        : RowSignature.Finalization.NO
+    );

Review Comment:
   I realised that it shouldn't work. For example - look at 
[GroupByPreShuffleFrameProcessor](https://github.com/apache/druid/blob/master/extensions-core/multi-stage-query/src/main/java/org/apache/druid/msq/querykit/groupby/GroupByPreShuffleFrameProcessor.java#L100)
 and 
[GroupByPostShuffleFrameProcessor](https://github.com/apache/druid/blob/master/extensions-core/multi-stage-query/src/main/java/org/apache/druid/msq/querykit/groupby/GroupByPostShuffleFrameProcessor.java#L107).
 The same query requires different finalization modes, since one partially 
aggregates and we need to intermediate type while the other completely 
aggregates and finalizes. This information isn't fully captured by the query 
and needs someone from the outside to tell which finalization mode to use. 
Therefore we can't trustily determine based on the query context. 



-- 
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...@druid.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@druid.apache.org
For additional commands, e-mail: commits-h...@druid.apache.org

Reply via email to