2010YOUY01 commented on code in PR #27393: URL: https://github.com/apache/datafusion/pull/27393#discussion_r4570476909
########## datafusion/sqllogictest/test_files/copy.slt: ########## @@ -823,3 +823,46 @@ physical_plan statement count 0 drop table t; + +# COPY (... UNION ALL ... ORDER BY) must write rows in ORDER BY order when +# each UNION ALL arm selects a different literal and reads an already sorted +# input. The literal is constant within each arm but not across arms, so it +# must stay in the merge key. +# +# Earlier versions reported only [ts ASC NULLS LAST] as the merge key in SortPreservingMergeExec due to issues with the +# constants in the individual partitions. + +statement ok +COPY (SELECT * FROM (VALUES (1, 10.0), (2, 20.0), (3, 30.0)) AS v(ts, x) ORDER BY ts) Review Comment: good point, [d669651](https://github.com/apache/datafusion/pull/27393/commits/d669651801149cbd1f759891e329cb6383ac4651) -- 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]
