aboutsummaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorCheng Lian <lian@databricks.com>2016-07-25 17:22:29 +0800
committerWenchen Fan <wenchen@databricks.com>2016-07-25 17:22:29 +0800
commit68b4020d0c0d4f063facfbf4639ef4251dcfda8b (patch)
tree1edd2d7b868418d533dbc30cafe484b120f74f8d /common
parent468a3c3ac5d039f21613f9237c7bdef9b92f5fea (diff)
downloadspark-68b4020d0c0d4f063facfbf4639ef4251dcfda8b.tar.gz
spark-68b4020d0c0d4f063facfbf4639ef4251dcfda8b.tar.bz2
spark-68b4020d0c0d4f063facfbf4639ef4251dcfda8b.zip
[SPARK-16648][SQL] Make ignoreNullsExpr a child expression of First and Last
## What changes were proposed in this pull request? Default `TreeNode.withNewChildren` implementation doesn't work for `Last` and 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, `child` and `ignoreNullsExpr`, are `Expression`s. When they have the same value, `TreeNode.withNewChildren` treats both of them as child nodes by mistake. `First` is also affected by this issue in exactly the same way. This PR fixes this issue by making `ignoreNullsExpr` a child expression of `First` and `Last`. ## How was this patch tested? New test case added in `WindowQuerySuite`. Author: Cheng Lian <lian@databricks.com> Closes #14295 from liancheng/spark-16648-last-value.
Diffstat (limited to 'common')
0 files changed, 0 insertions, 0 deletions