alamb commented on code in PR #20858:
URL: https://github.com/apache/datafusion/pull/20858#discussion_r2923968106


##########
datafusion/physical-plan/src/aggregates/row_hash.rs:
##########
@@ -1267,6 +1267,18 @@ impl GroupedHashAggregateStream {
             // on the grouping columns.
             self.group_ordering = 
GroupOrdering::Full(GroupOrderingFull::new());
 
+            // Recreate group_values to use streaming mode 
(GroupValuesColumn<true>
+            // with scalarized_intern) which preserves input row order, as 
required
+            // by GroupOrderingFull. This is only needed for multi-column 
group by,
+            // since single-column uses GroupValuesPrimitive which is always 
safe.

Review Comment:
   ```suggestion
               // Recreate `group_values` for streaming merge so group ids are 
assigned
               // in first-seen order, as required by `GroupOrderingFull`.
               // The pre-spill multi-column collector may use 
`vectorized_intern`, which
               // can assign new group ids out of input order under hash 
collisions.
   ```



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