GitHub user liancheng opened a pull request:

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

    [SPARK-16648][SQL] Overrides TreeNode.withNewChildren in Last

    ## What changes were proposed in this pull request?
    
    Default `TreeNode.withNewChildren` implementation doesn't work for `Last` 
when both constructor arguments are the same, e.g.:
    
    ```sql
    LAST_VALUE(FALSE) // The 2nd argument defaults to FALSE
    LAST_VALUE(FALSE, FALSE)
    LAST_VALUE(TRUE, TRUE)
    ```
    
    This is because although `Last` is a unary expression, both of its 
constructor arguments are `Expression`s. When they have the same value, 
`TreeNode.withNewChildren` treats both of them as child nodes by mistake.
    
    ## How was this patch tested?
    
    New test case added in `WindowQuerySuite`.

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

    $ git pull https://github.com/liancheng/spark spark-16648-last-value

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

    https://github.com/apache/spark/pull/14295.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 #14295
    
----
commit efbed9110b771a4f506292f73d4f0e6cb77e52d0
Author: Cheng Lian <l...@databricks.com>
Date:   2016-07-21T04:48:16Z

    Overrides TreeNode.withNewChildren in Last

----


---
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

Reply via email to