GitHub user jiangxb1987 opened a pull request:

    https://github.com/apache/spark/pull/18814

    [SPARK-21608][SPARK-9221][SQL] Window rangeBetween() API should allow 
literal boundary

    ## What changes were proposed in this pull request?
    
    Window rangeBetween() API should allow literal boundary, that means, the 
window range frame can calculate frame of double/date/timestamp.
    
    Example of the use case can be:
    ```
    SELECT
        val_timestamp,
        cate,
        avg(val_timestamp) OVER(PARTITION BY cate ORDER BY val_timestamp RANGE 
BETWEEN CURRENT ROW AND interval 23 days 4 hours FOLLOWING)
    FROM testData
    ```
    
    This PR refactors the Window `rangeBetween` and `rowsBetween` API, while 
the legacy user code should still be valid.
    
    ## How was this patch tested?
    
    Add new test cases both in `DataFrameWindowFunctionsSuite` and in 
`window.sql`.

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

    $ git pull https://github.com/jiangxb1987/spark literal-boundary

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

    https://github.com/apache/spark/pull/18814.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 #18814
    
----
commit a6d111b656320a06f197f18ab149803ec6b0a913
Author: Xingbo Jiang <[email protected]>
Date:   2017-08-02T06:16:02Z

    refactor Window rangeBetween API

commit 7893e5dd7aa37daa6c176e7228a2a71938d78514
Author: Xingbo Jiang <[email protected]>
Date:   2017-08-02T07:33:57Z

    code cleanup

----


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

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to