mustafasrepo opened a new issue, #5915: URL: https://github.com/apache/arrow-datafusion/issues/5915
### Is your feature request related to a problem or challenge? Currently when window frame is `PARTITION BY a,b ORDER BY c` and input is ordered by `b, a, c`. `WindowAggExec` expects its input to be ordered by `a, b`. Hence we need to add another `SortExec` before `WindowAggExec` to change ordering from `b, a, c` to `a, b, c`. However, if we were to use equivalent window expression:`PARTITION BY b, a ORDER BY c` existing ordering would work. The algorithm for removing sort should treat partition by columns as set. Algorithm shouldn't depend on the order of the columns. With this functionality we can produce better plans. ### Describe the solution you'd like PARTITION BY columns should be treated as set. As longs any permutation of the PARTITION by expressions matches existing ordering. Existing ordering shouldn't be changed. ### Describe alternatives you've considered _No response_ ### Additional context _No response_ -- 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]
