Rich-T-kid commented on code in PR #27025:
URL: https://github.com/apache/datafusion/pull/27025#discussion_r4455721999
##########
datafusion/common/src/hash_utils.rs:
##########
@@ -158,8 +181,14 @@ where
let mut buffer = cell.try_borrow_mut()
.map_err(|_| _internal_datafusion_err!("with_hashes cannot be
called reentrantly on the same thread"))?;
- // Ensure buffer has sufficient length, clearing old values
- buffer.clear();
+ // A dictionary with non-null keys and values overwrites every output
+ // slot, so retain the initialized storage instead of zeroing it first.
Review Comment:
Fixed in 0a7c4da0c. The reuse gate now uses the cheap conservative
Dictionary plus !is_nullable() check, avoiding the extra dictionary downcast
and duplicate null-count pair.
##########
datafusion/common/src/hash_utils.rs:
##########
@@ -2284,6 +2368,78 @@ mod tests {
assert_eq!(result, expected_hashes);
}
+ #[test]
+ #[cfg(not(feature = "force_hash_collisions"))]
Review Comment:
Addressed in 0a7c4da0c with a brief comment: PrimitiveArray::values()
already accounts for slices, and every dictionary key width uses the same
generic as_usize lookup, so neither changes the fast-path invariant.
--
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]