jayzhan211 commented on code in PR #7629:
URL: https://github.com/apache/arrow-datafusion/pull/7629#discussion_r1357608715
##########
datafusion/physical-expr/src/aggregate/array_agg_ordered.rs:
##########
@@ -282,39 +283,40 @@ impl Accumulator for OrderSensitiveArrayAggAccumulator {
impl OrderSensitiveArrayAggAccumulator {
fn convert_array_agg_to_orderings(
&self,
- in_data: ScalarValue,
- ) -> Result<Vec<Vec<ScalarValue>>> {
- if let ScalarValue::List(Some(list_vals), _field_ref) = in_data {
- list_vals.into_iter().map(|struct_vals| {
- if let ScalarValue::Struct(Some(orderings), _fields) =
struct_vals {
- Ok(orderings)
- } else {
- exec_err!(
- "Expects to receive ScalarValue::Struct(Some(..), _)
but got:{:?}",
- struct_vals.data_type()
- )
- }
- }).collect::<Result<Vec<_>>>()
- } else {
- exec_err!(
- "Expects to receive ScalarValue::List(Some(..), _) but
got:{:?}",
- in_data.data_type()
- )
+ array_agg: Vec<Vec<ScalarValue>>,
+ ) -> Result<Vec<Vec<Vec<ScalarValue>>>> {
Review Comment:
I left the comment from merge_ordered_arrays for now. I think there might be
some space to improve `OrderSensitiveArrayAggAccumulator`, but it is better to
do it in another PR.
--
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]