gianm commented on code in PR #16326:
URL: https://github.com/apache/druid/pull/16326#discussion_r1941496159
##########
extensions-core/multi-stage-query/src/main/java/org/apache/druid/msq/querykit/groupby/GroupByPostShuffleFrameProcessor.java:
##########
@@ -263,6 +267,41 @@ private void writeCurrentFrameIfNeeded() throws IOException
outputChannel.write(new FrameWithPartition(frame,
FrameWithPartition.NO_PARTITION));
frameWriter.close();
frameWriter = null;
+ outputRows += frame.numRows();
+ }
+ }
+
+ /**
+ * Generate a frame containing a single row with default values of all
aggregations if needed. This method uses
+ * {@link GroupingEngine#summaryRowPreconditions(GroupByQuery)} to determine
if such an operation is needed.
+ *
+ * Note that in cases where {@link
GroupingEngine#summaryRowPreconditions(GroupByQuery)} returns true, the
+ * preceding {@link GroupByPreShuffleFrameProcessorFactory} stage would use
an empty {@link ClusterBy}. Therefore,
+ * there would only be a single output partition of the prior stage, and
therefore a single instance of
+ * this processor. This ensures that only a single null-aggregations row is
generated for the entire stage.
+ */
+ private void writeEmptyAggregationsFrameIfNeeded() throws IOException
+ {
+ // Check isIncludeNullResultRow, which is populated by the SQL planner
when doing a query like GROUP BY ().
Review Comment:
Ah, this was an outdated comment. I removed it.
--
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]