alamb commented on code in PR #13524:
URL: https://github.com/apache/datafusion/pull/13524#discussion_r1869743616
##########
datafusion/physical-plan/src/aggregates/group_values/multi_group_by/mod.rs:
##########
@@ -1083,67 +1083,63 @@ impl<const STREAMING: bool> GroupValues for
GroupValuesColumn<STREAMING> {
.collect::<Vec<_>>();
let mut next_new_list_offset = 0;
- // SAFETY: self.map outlives iterator and is not modified
concurrently
- unsafe {
- for bucket in self.map.iter() {
- // In non-streaming case, we need to check if the
`group index view`
- // is `inlined` or `non-inlined`
- if !STREAMING && bucket.as_ref().1.is_non_inlined() {
- // Non-inlined case
- // We take `group_index_list` from
`old_group_index_lists`
-
- // list_offset is incrementally
- self.emit_group_index_list_buffer.clear();
- let list_offset = bucket.as_ref().1.value() as
usize;
- for group_index in
self.group_index_lists[list_offset].iter()
- {
- if let Some(remaining) =
group_index.checked_sub(n) {
-
self.emit_group_index_list_buffer.push(remaining);
- }
+ self.map.retain(|(_exist_hash, group_idx_view)| {
Review Comment:
💯 for removing the unsafe
--
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]