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


##########
datafusion/functions-aggregate/src/min_max/min_max_bytes.rs:
##########
@@ -450,7 +443,7 @@ impl MinMaxBytesState {
         // Minimize value copies by calculating the new min/maxes for each 
group
         // in this batch (either the existing min/max or the new input value)
         // and updating the owned values in `self.min_maxes` at most once
-        let mut locations = vec![MinMaxLocation::ExistingMinMax; 
total_num_groups];
+        let mut locations = HashMap::<usize, 
&[u8]>::with_capacity(group_indices.len());

Review Comment:
   i tried a few different thing to avoid having to allocate a HashMap -- like 
ideally we could at least reuse the allocation from invocation to invocation
   
   However, as it is setup now it has a slice into the input array so any 
structure ends up with a lifetime tied to the input, which I couldn't figure 
out how to reuse across calls to different input 🤔 



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