kosiew commented on code in PR #25825:
URL: https://github.com/apache/datafusion/pull/25825#discussion_r4152709268
##########
datafusion/physical-plan/src/aggregates/group_values/single_group_by/primitive.rs:
##########
@@ -322,4 +322,90 @@ mod tests {
Ok(())
}
+
+ #[test]
+ fn test_exact_hash_table_allocation_accounting() -> Result<()> {
+ let mut group_values =
GroupValuesPrimitive::<Int32Type>::new(DataType::Int32);
+
+ // 1. Initial state: map is unallocated
+ assert_eq!(group_values.map.capacity(), 0);
Review Comment:
`GroupValuesPrimitive::new` creates the map with
`HashTable::with_capacity(128)`, so it already has retained allocation here and
this zero-capacity assertion fails. Please assert the constructor's nonzero
allocation and verify that `size()` includes it, unless the test specifically
constructs an empty table to test zero allocation.
--
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]