eshed-flarion commented on code in PR #15924: URL: https://github.com/apache/datafusion/pull/15924#discussion_r2084949448
########## datafusion/functions-aggregate/src/first_last.rs: ########## @@ -1772,4 +1790,60 @@ mod tests { Ok(()) } + + #[test] + fn test_first_list_acc_size() -> Result<()> { + fn size_after_batch(values: &[ArrayRef]) -> Result<usize> { + let mut first_accumulator = FirstValueAccumulator::try_new( + &DataType::List(Arc::new(Field::new_list_field(DataType::Int64, false))), + &[], + LexOrdering::default(), + false, + )?; + + first_accumulator.update_batch(values)?; + + Ok(first_accumulator.size()) + } + + let batch1 = ListArray::from_iter_primitive::<Int32Type, _, _>( + repeat_with(|| Some(vec![Some(1)])).take(10000), + ); + let batch2 = + ListArray::from_iter_primitive::<Int32Type, _, _>([Some(vec![Some(1)])]); + + let size1 = size_after_batch(&[Arc::new(batch1)])?; + let size2 = size_after_batch(&[Arc::new(batch2)])?; + assert_eq!(size1, size2); + + Ok(()) + } + + #[test] + fn test_last_list_acc_size() -> Result<()> { + fn size_after_batch(values: &[ArrayRef]) -> Result<usize> { + let mut last_accumulator = FirstValueAccumulator::try_new( Review Comment: :facepalm: -- 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