wangyum opened a new pull request, #36990: URL: https://github.com/apache/spark/pull/36990
### What changes were proposed in this pull request? This PR adds support more cases for pushing down limit through window: ```sql SELECT *, ROW_NUMBER() OVER(PARTITION BY a ORDER BY b) AS rn FROM Tab1 LIMIT 5; SELECT * FROM (SELECT *, row_number() OVER(PARTITION BY a ORDER BY b) AS rn FROM tab1) t WHERE rn <= 5 LIMIT 5 ``` ### Why are the changes needed? Improve query performance. Impala also support it: https://issues.apache.org/jira/browse/IMPALA-9983 ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? Unit test and benchmark test: SQL | Spark 3.3.0(Seconds) | Carmel Spark(Seconds) -- | -- | -- TPC-DS q67 | 1589 | 137 -- 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]
