wangyum opened a new pull request, #36848:
URL: https://github.com/apache/spark/pull/36848
### What changes were proposed in this pull request?
This PR adds support propagate empty relation through `Window`. For example:
```sql
SELECT id,
Count(*)
OVER (
ORDER BY id)
FROM (SELECT /*+ REPARTITION(3) */ *
FROM Range(100)
WHERE id < 0) t
```
After this PR:
```
== Physical Plan ==
AdaptiveSparkPlan (10)
+- == Final Plan ==
LocalTableScan (1)
+- == Initial Plan ==
CollectLimit (9)
+- Project (8)
+- Window (7)
+- Sort (6)
+- Exchange (5)
+- Exchange (4)
+- Filter (3)
+- Range (2)
```
### Why are the changes needed?
Improve query performance.
### Does this PR introduce _any_ user-facing change?
No.
### How was this patch tested?
Unit test.
--
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]