GitHub user jinxing64 opened a pull request: https://github.com/apache/spark/pull/18634
[SPARK-21414] Refine SlidingWindowFunctionFrame to avoid OOM. ## What changes were proposed in this pull request? In `SlidingWindowFunctionFrame`, it is now adding all rows to the buffer for which the input row value is equal to or less than the output row upper bound, then drop all rows from the buffer for which the input row value is smaller than the output row lower bound. This could result in the buffer is very big though the window is small. For example: ``` select a, b, sum(a) over (partition by b order by a range between 1000000 following and 1000001 following) from table ``` We can refine the logic and just add the qualified rows into buffer. ## How was this patch tested? Added test. You can merge this pull request into a Git repository by running: $ git pull https://github.com/jinxing64/spark SPARK-21414 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/spark/pull/18634.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #18634 ---- commit 5103ae80d456ca26c7b853f99e73c4a2c152ad41 Author: jinxing <jinxing6...@126.com> Date: 2017-07-12T12:02:28Z Refine SlidingWindowFunctionFrame to avoid OOM. ---- --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org