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


##########
datafusion/physical-plan/src/aggregates/group_values/single_group_by/bytes.rs:
##########
@@ -141,6 +141,7 @@ impl<O: OffsetSizeTrait> GroupValues for 
GroupValuesBytes<O> {
         // release the map's allocations rather than restoring the warm up
         // capacities that `take` keeps for the emit path.
         self.map.clear_and_release();
+        self.num_groups = 0;

Review Comment:
   Could you also add a post-clear `intern` check here, and for `bytes_view`, 
to verify that the first new distinct value gets group ID 0? The current tests 
show that `len()` resets, but this would directly protect the group-index 
invariant.



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