rkrishn7 commented on PR #14829:
URL: https://github.com/apache/datafusion/pull/14829#issuecomment-2677289153

   Thanks @alamb @berkaysynnada!
   
   Yeah, not too sure why it was there 🤔. For additional context, this also was 
occurring for `UNION ALL`, when only one input in the union had an ordering and 
there were constants on both sides. For example:
   
   ```
   > create table t1 (a int);
   0 row(s) fetched.
   Elapsed 0.003 seconds.
   
   > select a, 1 from t1 union all select 2, 1 from t1 order by 1;
   SanityCheckPlan
   caused by
   Error during planning: Plan: ["SortPreservingMergeExec: [a@0 ASC NULLS 
LAST]", "  UnionExec", "    SortExec: expr=[a@0 ASC NULLS LAST], 
preserve_partitioning=[false]", "      ProjectionExec: expr=[CAST(a@0 AS Int64) 
as a, 1 as Int64(1)]", "        DataSourceExec: partitions=1, 
partition_sizes=[0]", "    ProjectionExec: expr=[2 as a, 1 as Int64(1)]", "     
 DataSourceExec: partitions=1, partition_sizes=[0]"] does not satisfy order 
requirements: [a@0 ASC NULLS LAST]. Child-0 order: []
   ```
   
   The tests fixed here should cover this, but happy to add another test for 
`UNION ALL` if you both think it makes sense.


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