vegarsti commented on code in PR #17891:
URL: https://github.com/apache/datafusion/pull/17891#discussion_r2399994514
##########
datafusion/functions-aggregate/src/array_agg.rs:
##########
@@ -687,13 +687,16 @@ impl Accumulator for OrderSensitiveArrayAggAccumulator {
// Convert array to Scalars to sort them easily. Convert back to array
at evaluation.
let array_agg_res =
ScalarValue::convert_array_to_scalar_vec(array_agg_values)?;
- for v in array_agg_res.into_iter() {
- partition_values.push(v.into());
+ for maybe_v in array_agg_res.into_iter() {
+ if let Some(v) = maybe_v {
+ partition_values.push(v.into());
+ } else {
+ partition_values.push(vec![].into());
+ }
Review Comment:
I'm not sure about this one! With the other changes, the group_by slt tests
fail without this change. It is because in `merge_ordered_arrays` we require
that `partition_values` and `partition_ordering_values` have the same length
(see code snippet below). But that seems a bit weird since we now only do
`partition_ordering_values.push(ordering_value)` if the element in `orderings`
is `Some`.
https://github.com/apache/datafusion/blob/71512e676d8c025fd2e4e8e9513e49247c74cd28/datafusion/functions-aggregate-common/src/merge_arrays.rs#L125-L133
--
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]