nuno-faria commented on code in PR #17528:
URL: https://github.com/apache/datafusion/pull/17528#discussion_r2348169771
##########
datafusion/physical-plan/src/windows/bounded_window_agg_exec.rs:
##########
@@ -870,9 +879,11 @@ impl SortedSearch {
cur_window_expr_out_result_len
});
argmin(out_col_counts).map_or(0, |(min_idx, minima)| {
- for (row, count) in counts.swap_remove(min_idx).into_iter() {
- let partition_batch = &mut partition_buffers[row];
- partition_batch.n_out_row = count;
+ let mut counts = counts.swap_remove(min_idx);
+ for (partition_key, partition_batch) in
partition_buffers.iter_mut() {
+ if let Some(count) = counts.remove(partition_key) {
Review Comment:
The new `counts` here is an `HashMap`, so its O(N) but the naming is
confusing. I've updated the variable.
--
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]