kosiew commented on code in PR #26154:
URL: https://github.com/apache/datafusion/pull/26154#discussion_r4266442938


##########
datafusion/functions-aggregate/src/min_max/min_max_bytes.rs:
##########
@@ -543,6 +557,103 @@ mod tests {
     use super::*;
     use arrow::array::StringArray;
 
+    #[test]
+    fn size_counts_outer_capacity() {
+        let mut state = MinMaxBytesState::new(DataType::Utf8);
+        assert_eq!(state.size(), 0);
+
+        state.min_max = Vec::with_capacity(16);
+        state.min_max.resize(3, None);
+        assert_eq!(
+            state.size(),
+            state.min_max.capacity() * size_of::<Option<Vec<u8>>>()
+        );
+    }
+
+    #[test]
+    fn size_retains_inner_capacity() -> Result<()> {
+        for is_min in [true, false] {

Review Comment:
   I’ll consolidate into one lifecycle test: empty/preallocated outer storage, 
growth, 128→1-byte replacement with unchanged retained size, partial/full 
emission, and reuse. A traversal helper will replace repeated formulas and 
subtraction; I’ll retain emitted-value/byte-count checks and coverage of both 
partial-emission allocation branches.



-- 
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]

Reply via email to