alamb commented on code in PR #19421:
URL: https://github.com/apache/datafusion/pull/19421#discussion_r2637059587


##########
datafusion/physical-plan/src/aggregates/group_values/multi_group_by/bytes_view.rs:
##########
@@ -948,4 +915,28 @@ mod tests {
         let taken_array = builder.take_n(final_ones_to_append);
         assert_eq!(&taken_array, &input_array);
     }
+
+    #[test]
+    fn test_byte_view_take_n_partial_completed_nonzero_index() {
+        let mut builder =
+            
ByteViewGroupValueBuilder::<StringViewType>::new().with_max_block_size(30);
+        let input_array = StringViewArray::from(vec![
+            Some("aaaaaaaaaaaaaa"),
+            Some("bbbbbbbbbbbbbb"),
+            Some("cccccccccccccc"),
+            Some("dddddddddddddd"),
+            Some("eeeeeeeeeeeeee"),
+        ]);
+        let input_array: ArrayRef = Arc::new(input_array);
+
+        for row in 0..input_array.len() {
+            builder.append_val(&input_array, row).unwrap();
+        }
+
+        assert_eq!(builder.completed.len(), 2);
+        assert_eq!(builder.in_progress.len(), 14);
+
+        let taken_array = builder.take_n(3);
+        assert_eq!(&taken_array, &input_array.slice(0, 3));

Review Comment:
   This test fails like this without the code change
   
   ```
   thread 
'aggregates::group_values::multi_group_by::bytes_view::tests::test_byte_view_take_n_partial_completed_nonzero_index'
 (5274303) panicked at 
datafusion/physical-plan/src/aggregates/group_values/multi_group_by/bytes_view.rs:938:9:
   assertion `left == right` failed
     left: StringViewArray
   [
     "aaaaaaaaaaaaaa",
     "bbbbbbbbbbbbbb",
     "eeeeeeeeeeeeee",
   ]
    right: StringViewArray
   [
     "aaaaaaaaaaaaaa",
     "bbbbbbbbbbbbbb",
     "cccccccccccccc",
   ]
   ```



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