findepi commented on code in PR #16625:
URL: https://github.com/apache/datafusion/pull/16625#discussion_r2176919070


##########
datafusion/sqllogictest/test_files/group_by.slt:
##########
@@ -2741,21 +2745,20 @@ logical_plan
 01)Projection: sales_global.country, array_agg(sales_global.amount) ORDER BY 
[sales_global.amount DESC NULLS FIRST] AS amounts, 
first_value(sales_global.amount) ORDER BY [sales_global.amount ASC NULLS LAST] 
AS fv1, last_value(sales_global.amount) ORDER BY [sales_global.amount DESC 
NULLS FIRST] AS fv2
 02)--Aggregate: groupBy=[[sales_global.country]], 
aggr=[[array_agg(sales_global.amount) ORDER BY [sales_global.amount DESC NULLS 
FIRST], first_value(sales_global.amount) ORDER BY [sales_global.amount ASC 
NULLS LAST], last_value(sales_global.amount) ORDER BY [sales_global.amount DESC 
NULLS FIRST]]]
 03)----TableScan: sales_global projection=[country, amount]
-physical_plan
-01)ProjectionExec: expr=[country@0 as country, array_agg(sales_global.amount) 
ORDER BY [sales_global.amount DESC NULLS FIRST]@1 as amounts, 
first_value(sales_global.amount) ORDER BY [sales_global.amount ASC NULLS 
LAST]@2 as fv1, last_value(sales_global.amount) ORDER BY [sales_global.amount 
DESC NULLS FIRST]@3 as fv2]
-02)--AggregateExec: mode=Single, gby=[country@0 as country], 
aggr=[array_agg(sales_global.amount) ORDER BY [sales_global.amount DESC NULLS 
FIRST], first_value(sales_global.amount) ORDER BY [sales_global.amount ASC 
NULLS LAST], last_value(sales_global.amount) ORDER BY [sales_global.amount DESC 
NULLS FIRST]]
-03)----DataSourceExec: partitions=1, partition_sizes=[1]
+physical_plan_error
+01)Internal error: Input field name last_value(sales_global.amount) ORDER BY 
[sales_global.amount DESC NULLS FIRST] does not match with the projection 
expression first_value(sales_global.amount) ORDER BY [sales_global.amount ASC 
NULLS LAST].
+02)This was likely caused by a bug in DataFusion's code and we would welcome 
that you file an bug report in our issue tracker
 
-query T?RR rowsort
+query error
 SELECT country, ARRAY_AGG(amount ORDER BY amount DESC) AS amounts,
   FIRST_VALUE(amount ORDER BY amount ASC) AS fv1,
   LAST_VALUE(amount ORDER BY amount DESC) AS fv2
   FROM sales_global
   GROUP BY country
 ----
-FRA [200.0, 50.0] 50 50
-GRC [80.0, 30.0] 30 30
-TUR [100.0, 75.0] 75 75
+DataFusion error: Internal error: Input field name 
last_value(sales_global.amount) ORDER BY [sales_global.amount DESC NULLS FIRST] 
does not match with the projection expression first_value(sales_global.amount) 
ORDER BY [sales_global.amount ASC NULLS LAST].
+This was likely caused by a bug in DataFusion's code and we would welcome that 
you file an bug report in our issue tracker

Review Comment:
   Unblocking beneficial ordering triggered an error around reversing 
first_value / last_value. 
   Fix coming.



-- 
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

Reply via email to