alamb opened a new issue, #10314: URL: https://github.com/apache/datafusion/issues/10314
### Is your feature request related to a problem or challenge? The `EnforceDistribution` physical optimizer pass in DataFusion in some cases will introduce `InterleaveExec` to increase partitioning when data passes through a `UnionExec`: https://github.com/apache/datafusion/blob/22311835bc1b4bd83b50e1c3875b0e725622b872/datafusion/core/src/physical_optimizer/enforce_distribution.rs#L1196-L1226 Here is what `InterleaveExec` does: https://github.com/apache/datafusion/blob/4edbdd7d09d97f361748c086afbd7b3dda972f76/datafusion/physical-plan/src/union.rs#L286-L317 However, this has the potential downside of destroying and pre-existing ordering which is sometimes preferable than increasing / improving partitionining (e.g. see https://github.com/apache/datafusion/issues/10257 and `datafusion.optimizer.prefer_existing_sort` setting) ### Describe the solution you'd like _No response_ ### Describe alternatives you've considered _No response_ ### Additional context While working on https://github.com/apache/datafusion/pull/10259 @mustafasrepo and @phillipleblanc pointed out that config flag `prefer_existing_union` was effectively the same as `prefer_existing_sort` -- 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: github-unsubscr...@datafusion.apache.org.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org For additional commands, e-mail: github-h...@datafusion.apache.org