kosiew commented on code in PR #25914:
URL: https://github.com/apache/datafusion/pull/25914#discussion_r4163321986


##########
datafusion/physical-plan/src/aggregates/group_values/row.rs:
##########
@@ -283,10 +283,15 @@ impl GroupValues for GroupValuesRows {
     }
 
     fn clear_shrink(&mut self, num_rows: usize) {
-        self.group_values = self.group_values.take().map(|mut rows| {
-            rows.clear();
-            rows
-        });
+        self.group_values = if num_rows == 0 {

Review Comment:
   The zero path drops `group_values`, but `rows_buffer` can still retain grown 
data and offset capacity, so `size()` may stay above its initial value after 
`clear_shrink(0)`. Please recreate `rows_buffer` with its initial capacities on 
this path, and extend the regression test so it grows both past 1,000 rows and 
past 64 KiB of encoded row data.



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