alamb commented on code in PR #27393:
URL: https://github.com/apache/datafusion/pull/27393#discussion_r4567720953
##########
datafusion/sqllogictest/test_files/aggregates_topk.slt:
##########
Review Comment:
maybe we could update the copy statement to store the data sorted? Like add
an ORDER BY ?
##########
datafusion/core/src/physical_planner.rs:
##########
@@ -1042,7 +1042,18 @@ impl DefaultPhysicalPlanner {
file_output_mode,
};
- let ordering =
input_exec.properties().output_ordering().cloned();
+ // For queries like:
+ // `COPY (SELECT * FROM t ORDER BY c1) TO 'ordered.parquet'`
+ // Preserve the explicit sort order as an input ordering
requirement,
+ // otherwise it might be lost during optimization.
Review Comment:
❤️
--
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]