huaxingao commented on code in PR #9991: URL: https://github.com/apache/arrow-datafusion/pull/9991#discussion_r1555287323
########## datafusion/sqllogictest/test_files/group_by.slt: ########## @@ -2129,41 +2129,11 @@ query III 1 2 1550 1 3 2175 - -# test_source_sorted_groupby2 -# If ordering is not important for the aggregation function, we should ignore the ordering requirement. Hence -# "ORDER BY a DESC" should have no effect. -query TT -EXPLAIN SELECT a, d, - SUM(c ORDER BY a DESC) as summation1 - FROM annotated_data_infinite2 - GROUP BY d, a ----- -logical_plan -Projection: annotated_data_infinite2.a, annotated_data_infinite2.d, SUM(annotated_data_infinite2.c) ORDER BY [annotated_data_infinite2.a DESC NULLS FIRST] AS summation1 ---Aggregate: groupBy=[[annotated_data_infinite2.d, annotated_data_infinite2.a]], aggr=[[SUM(CAST(annotated_data_infinite2.c AS Int64)) ORDER BY [annotated_data_infinite2.a DESC NULLS FIRST]]] -----TableScan: annotated_data_infinite2 projection=[a, c, d] -physical_plan -ProjectionExec: expr=[a@1 as a, d@0 as d, SUM(annotated_data_infinite2.c) ORDER BY [annotated_data_infinite2.a DESC NULLS FIRST]@2 as summation1] ---AggregateExec: mode=Single, gby=[d@2 as d, a@0 as a], aggr=[SUM(annotated_data_infinite2.c)], ordering_mode=PartiallySorted([1]) -----StreamingTableExec: partition_sizes=1, projection=[a, c, d], infinite_source=true, output_ordering=[a@0 ASC NULLS LAST] - -query III +statement error DataFusion error: This feature is not implemented: ORDER BY is not implemented for SUM Review Comment: I am not sure if I understand the requirement of https://github.com/apache/arrow-datafusion/issues/9924 correctly: In my PR, I have `support_ordering` to true for `first`, `last`, `nth_value` and `array_agg_ordered`. For all the other aggregate functions, `support_ordering` is false and `ORDER BY` returns `not implemented` error. Is this what we want? This seems to be a breaking change for me. -- 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]
