Skip to content

Test: Use unchecked group_value access in group hash #7010

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,14 @@ lto = false
opt-level = 3
overflow-checks = false
panic = 'unwind'
rpath = false
rpath = false


[patch.crates-io]
arrow = { git = "https://github.com/alamb/arrow-rs.git", rev="661caf3" }
arrow-array = { git = "https://github.com/alamb/arrow-rs.git", rev="661caf3" }
arrow-buffer = { git = "https://github.com/alamb/arrow-rs.git", rev="661caf3" }
arrow-flight = { git = "https://github.com/alamb/arrow-rs.git", rev="661caf3" }
arrow-schema = { git = "https://github.com/alamb/arrow-rs.git", rev="661caf3" }
arrow-cast = { git = "https://github.com/alamb/arrow-rs.git", rev="661caf3" }
parquet = { git = "https://github.com/alamb/arrow-rs.git", rev="661caf3" }
9 changes: 7 additions & 2 deletions datafusion/core/src/physical_plan/aggregates/row_hash.rs
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,10 @@ impl GroupedHashAggregateStream {
// verify that a group that we are inserting with hash is
// actually the same key value as the group in
// existing_idx (aka group_values @ row)
group_rows.row(row) == self.group_values.row(*group_idx)
unsafe {
group_rows.row_unchecked(row)
== self.group_values.row_unchecked(*group_idx)
}
});

let group_idx = match entry {
Expand All @@ -433,7 +436,9 @@ impl GroupedHashAggregateStream {
None => {
// Add new entry to aggr_state and save newly created index
let group_idx = self.group_values.num_rows();
self.group_values.push(group_rows.row(row));
unsafe {
self.group_values.push(group_rows.row_unchecked(row));
}

// for hasher function, use precomputed hash value
self.map.insert_accounted(
Expand Down