xudong963 commented on code in PR #18868:
URL: https://github.com/apache/datafusion/pull/18868#discussion_r2675527366
##########
datafusion/physical-optimizer/src/limit_pushdown.rs:
##########
@@ -337,4 +362,37 @@ fn add_global_limit(
Arc::new(GlobalLimitExec::new(pushdown_plan, skip, fetch)) as _
}
+/// Helper function to handle DataSourceExec preserve_order setting
+fn ensure_preserve_order_if_needed(
+ plan: Arc<dyn ExecutionPlan>,
+ order_sensitive: bool,
+) -> Arc<dyn ExecutionPlan> {
+ if !order_sensitive {
+ return plan;
+ }
+
+ let Some(data_source_exec) =
plan.as_any().downcast_ref::<DataSourceExec>() else {
+ return plan;
+ };
Review Comment:
Refactored in the commit
https://github.com/apache/datafusion/pull/18868/commits/95ea145b4356d7d0a3329cde2df47a390d39b85d
##########
datafusion/datasource-parquet/src/opener.rs:
##########
@@ -76,6 +76,8 @@ pub(super) struct ParquetOpener {
pub batch_size: usize,
/// Optional limit on the number of rows to read
pub limit: Option<usize>,
+ /// If should keep the output rows in order
+ pub preserve_order: bool,
Review Comment:
yeah, it could, thanks
--
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]