tschwarzinger commented on PR #27170:
URL: https://github.com/apache/datafusion/pull/27170#issuecomment-6691127120
Results without the fix (continuation of the slt test):
```text
query I
COPY (
SELECT id, ts, x FROM (
SELECT 'b' AS id, ts, x FROM union_const_src
UNION ALL
SELECT 'a' AS id, ts, x FROM union_const_src
) ORDER BY id, ts
) TO 'test_files/scratch/copy/union_const_order/out.parquet';
----
6
statement ok
CREATE EXTERNAL TABLE X STORED AS PARQUET
LOCATION 'test_files/scratch/copy/union_const_order/out.parquet';
query TIR
SELECT * FROM X;
----
b 1 10 // <--- No longer sorted by id!
a 1 10
b 2 20
a 2 20
b 3 30
a 3 30
```
Results after the fix:
```text
query I
COPY (
SELECT id, ts, x FROM (
SELECT 'b' AS id, ts, x FROM union_const_src
UNION ALL
SELECT 'a' AS id, ts, x FROM union_const_src
) ORDER BY id, ts
) TO 'test_files/scratch/copy/union_const_order/out.parquet';
----
6
statement ok
CREATE EXTERNAL TABLE X STORED AS PARQUET
LOCATION 'test_files/scratch/copy/union_const_order/out.parquet';
query TIR
SELECT * FROM X;
----
a 1 10
a 2 20
a 3 30
b 1 10
b 2 20
b 3 30
```
--
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]