jayzhan211 commented on code in PR #11943: URL: https://github.com/apache/datafusion/pull/11943#discussion_r1726498635
########## datafusion/physical-plan/src/aggregates/group_values/row.rs: ########## @@ -121,16 +135,31 @@ impl GroupValues for GroupValuesRows { create_hashes(cols, &self.random_state, batch_hashes)?; for (row, &target_hash) in batch_hashes.iter().enumerate() { + let mode = self.mode; let entry = self.map.get_mut(target_hash, |(exist_hash, group_idx)| { // Somewhat surprisingly, this closure can be called even if the // hash doesn't match, so check the hash first with an integer // comparison first avoid the more expensive comparison with // group value. https://github.com/apache/datafusion/pull/11718 - target_hash == *exist_hash - // verify that the 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) == group_values.row(*group_idx) + if target_hash != *exist_hash { + return false; + } + + // verify that the group that we are inserting with hash is + // actually the same key value as the group in + // existing_idx (aka group_values @ row) + match mode { + GroupStatesMode::Flat => { + group_rows.row(row) + == group_values.current().unwrap().row(*group_idx) + } + GroupStatesMode::Blocked(_) => { + let blocked_index = BlockedGroupIndex::new(*group_idx); + group_rows.row(row) + == group_values[blocked_index.block_id] Review Comment: #7095 looks like a interesting idea. Hashing is the bottleneck that I always want to break through, vectorized hashing does make sense -- 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-unsubscr...@datafusion.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org For additional commands, e-mail: github-h...@datafusion.apache.org