You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@datafusion.apache.org by "rluvaton (via GitHub)" <gi...@apache.org> on 2025/12/20 19:59:23 UTC
[PR] chore: use extend instead of manual loop in multi group by [datafusion]
rluvaton opened a new pull request, #19429:
URL: https://github.com/apache/datafusion/pull/19429
## Which issue does this PR close?
N/A
## Rationale for this change
using more efficient extend
## What changes are included in this PR?
replace manual loop with `extend`
## Are these changes tested?
existing tests
## Are there any user-facing changes?
Nope
--
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: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [PR] chore: use extend instead of manual loop in multi group by [datafusion]
Posted by "rluvaton (via GitHub)" <gi...@apache.org>.
rluvaton commented on code in PR #19429:
URL: https://github.com/apache/datafusion/pull/19429#discussion_r2637321226
##########
datafusion/physical-plan/src/aggregates/group_values/multi_group_by/mod.rs:
##########
@@ -540,14 +540,13 @@ impl<const STREAMING: bool> GroupValuesColumn<STREAMING> {
// into `vectorized_equal_to_row_indices` and `vectorized_equal_to_group_indices`.
let list_offset = group_index_view.value() as usize;
let group_index_list = &self.group_index_lists[list_offset];
- for &group_index in group_index_list {
- self.vectorized_operation_buffers
- .equal_to_row_indices
- .push(row);
- self.vectorized_operation_buffers
- .equal_to_group_indices
- .push(group_index);
- }
+
+ self.vectorized_operation_buffers
+ .equal_to_group_indices
+ .extend_from_slice(group_index_list);
+ self.vectorized_operation_buffers
+ .equal_to_row_indices
+ .extend(std::iter::repeat_n(row, group_index_list.len()));
Review Comment:
Note: I swapped the order here, first insert the `equal_to_group_indices` and then `equal_to_row_indices` to make `equal_to_group_indices` closer to `group_index_list`
--
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: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [PR] chore: use extend instead of manual loop in multi group by [datafusion]
Posted by "rluvaton (via GitHub)" <gi...@apache.org>.
rluvaton merged PR #19429:
URL: https://github.com/apache/datafusion/pull/19429
--
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: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org