spark-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rxin <>
Subject [GitHub] spark pull request #15438: [SPARK-17845][SQL] More self-evident window funct...
Date Tue, 11 Oct 2016 20:32:12 GMT
GitHub user rxin opened a pull request:

    	[SPARK-17845][SQL] More self-evident window function frame boundary API

    ## What changes were proposed in this pull request?
    This patch improves the window function frame boundary API to make it more obvious to
read and to use. The two high level changes are:
    1. Create Window.currentRow, Window.unboundedPreceding, Window.unboundedFollowing to indicate
the special values in frame boundaries. These methods map to the special integral values so
we are not breaking backward compatibility here. This change makes the frame boundaries more
self-evident (instead of Long.MinValue, it becomes Window.unboundedPreceding).
    2. In Python, for any value less than or equal to JVM's Long.MinValue, treat it as Window.unboundedPreceding.
For any value larger than or equal to JVM's Long.MaxValue, treat it as Window.unboundedFollowing.
Before this change, if the user specifies any value that is less than Long.MinValue but not
-sys.maxsize (e.g. -sys.maxsize + 1), the number we pass over to the JVM would overflow, resulting
in a frame that does not make sense.
    ## How was this patch tested?
    Updated DataFrameWindowSuite (for Scala/Java) and test_window_functions_cumulative_sum
(for Python).

You can merge this pull request into a Git repository by running:

    $ git pull SPARK-17845

Alternatively you can review and apply these changes as the patch at:

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #15438
commit c91864b1df83e9f06a9a463aacf4d7db43478141
Author: Reynold Xin <>
Date:   2016-10-11T20:11:00Z

    [SPARK-17845][SQL] More self-evident window function frame boundary API

commit d806ae9a8423774a6a28c01de1668b97c32d9250
Author: Reynold Xin <>
Date:   2016-10-11T20:23:52Z

    Fixed Python test


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 or file a JIRA ticket
with INFRA.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message