Rich-T-kid commented on code in PR #23193:
URL: https://github.com/apache/datafusion/pull/23193#discussion_r3482997096
##########
datafusion/physical-plan/src/aggregates/group_values/single_group_by/bytes.rs:
##########
@@ -85,38 +85,18 @@ impl<O: OffsetSizeTrait> GroupValues for
GroupValuesBytes<O> {
}
fn emit(&mut self, emit_to: EmitTo) -> Result<Vec<ArrayRef>> {
- // Reset the map to default, and convert it into a single array
- let map_contents = self.map.take().into_state();
-
let group_values = match emit_to {
EmitTo::All => {
- self.num_groups -= map_contents.len();
- map_contents
- }
- EmitTo::First(n) if n == self.len() => {
- self.num_groups -= map_contents.len();
- map_contents
+ self.num_groups = 0;
+ self.map.take().into_state()
}
EmitTo::First(n) => {
Review Comment:
May be worth adding a match if branch here to see if n == group_size. in
that case also just use `into_state()`
--
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]