mustafasrepo commented on code in PR #6734: URL: https://github.com/apache/arrow-datafusion/pull/6734#discussion_r1238676008
########## datafusion/core/tests/sqllogictests/test_files/groupby.slt: ########## @@ -2580,12 +2580,280 @@ FRA 200 50 250 # Run order-sensitive aggregators in multiple partitions statement ok -set datafusion.execution.target_partitions = 2; +set datafusion.execution.target_partitions = 8; + +# order-sensitive FIRST_VALUE and LAST_VALUE aggregators should work in +# multi-partitions also. +query TT +EXPLAIN SELECT country, FIRST_VALUE(amount ORDER BY ts ASC) AS fv1, + LAST_VALUE(amount ORDER BY ts ASC) AS fv2 + FROM sales_global + GROUP BY country + ORDER BY country +---- +logical_plan +Sort: sales_global.country ASC NULLS LAST +--Projection: sales_global.country, FIRST_VALUE(sales_global.amount) ORDER BY [sales_global.ts ASC NULLS LAST] AS fv1, LAST_VALUE(sales_global.amount) ORDER BY [sales_global.ts ASC NULLS LAST] AS fv2 +----Aggregate: groupBy=[[sales_global.country]], aggr=[[FIRST_VALUE(sales_global.amount) ORDER BY [sales_global.ts ASC NULLS LAST], LAST_VALUE(sales_global.amount) ORDER BY [sales_global.ts ASC NULLS LAST]]] +------TableScan: sales_global projection=[country, ts, amount] +physical_plan +SortPreservingMergeExec: [country@0 ASC NULLS LAST] +--SortExec: expr=[country@0 ASC NULLS LAST] +----ProjectionExec: expr=[country@0 as country, FIRST_VALUE(sales_global.amount) ORDER BY [sales_global.ts ASC NULLS LAST]@1 as fv1, LAST_VALUE(sales_global.amount) ORDER BY [sales_global.ts ASC NULLS LAST]@2 as fv2] +------AggregateExec: mode=FinalPartitioned, gby=[country@0 as country], aggr=[FIRST_VALUE(sales_global.amount), LAST_VALUE(sales_global.amount)] +--------SortExec: expr=[ts@1 ASC NULLS LAST] Review Comment: Yes, exactly -- 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]
