bvolpato commented on code in PR #24273:
URL: https://github.com/apache/datafusion/pull/24273#discussion_r3771975136
##########
datafusion/physical-optimizer/src/limit_pushdown.rs:
##########
@@ -160,7 +160,7 @@ pub fn pushdown_limit_helper(
);
global_state.skip = skip;
global_state.fetch = fetch;
- global_state.preserve_order = limit_info.preserve_order;
+ global_state.preserve_order |= limit_info.preserve_order;
Review Comment:
Could we clear `preserve_order` when ordered fetch scope ends instead of
carrying it into later limits? For example, with
`SortPreservingMergeExec(fetch=5) -> SortExec -> LocalLimitExec(fetch=10) ->
DataSourceExec`, `SortExec` clears outer fetch, but this `|=` keeps flag set
and applies it to independent inner limit. That disables Parquet limit pruning
and file-stream work stealing even though inner limit is not order-sensitive.
Is this a concern, or am I missing where state is reset?
--
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]