alamb commented on code in PR #11493:
URL: https://github.com/apache/datafusion/pull/11493#discussion_r1679710719


##########
datafusion/sqllogictest/test_files/union.slt:
##########
@@ -602,3 +605,38 @@ physical_plan
 09)--ProjectionExec: expr=[1 as count, MAX(Int64(10))@0 as n]
 10)----AggregateExec: mode=Single, gby=[], aggr=[MAX(Int64(10))]
 11)------PlaceholderRowExec
+
+
+###

Review Comment:
   Without the code in this PR these tests fail like this:
   
   ```shell
   (venv) andrewlamb@Andrews-MacBook-Pro-2:~/Software/datafusion2$ cargo test 
--test sqllogictests -- union
      Compiling datafusion v40.0.0 
(/Users/andrewlamb/Software/datafusion2/datafusion/core)
      Compiling datafusion-sqllogictest v40.0.0 
(/Users/andrewlamb/Software/datafusion2/datafusion/sqllogictest)
       Finished `test` profile [unoptimized + debuginfo] target(s) in 6.10s
        Running bin/sqllogictests.rs 
(target/debug/deps/sqllogictests-6e33fb5db6770e8f)
   Running "pg_compat/pg_compat_union.slt"
   Running "union.slt"
   External error: query failed: DataFusion error: SanityCheckPlan
   caused by
   Error during planning: Child: ["UnionExec", "  SortExec: expr=[a@0 ASC NULLS 
LAST], preserve_partitioning=[true]", "    ProjectionExec: expr=[CAST(a@0 AS 
Utf8) as a]", "      RepartitionExec: partitioning=RoundRobinBatch(4), 
input_partitions=1", "        CsvExec: file_groups={1 group: 
[[Users/andrewlamb/Software/datafusion2/datafusion/core/tests/data/example.csv]]},
 projection=[a], output_ordering=[a@0 ASC NULLS LAST], has_header=true", "  
ProjectionExec: expr=[bar as a]", "    CsvExec: file_groups={1 group: 
[[Users/andrewlamb/Software/datafusion2/datafusion/core/tests/data/example.csv]]},
 has_header=true"] does not satisfy parent order requirements: 
[PhysicalSortRequirement { expr: Column { name: "a", index: 0 }, options: 
Some(SortOptions { descending: false, nulls_first: false }) }]
   [SQL] SELECT (SELECT a from t ORDER BY a) UNION ALL (SELECT 'bar' as a from 
t) ORDER BY a;
   at test_files/union.slt:629
   ```



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to