You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by peter-toth <gi...@git.apache.org> on 2018/10/24 19:03:23 UTC

[GitHub] spark pull request #22817: [SPARK-25816][SQL] ResolveReferences should work ...

GitHub user peter-toth opened a pull request:

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

    [SPARK-25816][SQL] ResolveReferences should work bottom-up manner on expressions

    ## What changes were proposed in this pull request?
    
    ResolveReferences works top-down manner when resolving the expression tree, this PR changes the resolution order to bottom-up and so solves some issues.
    This PR also replaces the `resolve` method to the more general `transformExpressionsUp`.
    
    ## How was this patch tested?
    
    added UT

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

    $ git pull https://github.com/peter-toth/spark SPARK-25816

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

    https://github.com/apache/spark/pull/22817.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 #22817
    
----
commit f62725f5378f365c58b4b01f2a078e5e93176cda
Author: Peter Toth <pe...@...>
Date:   2018-10-24T18:46:07Z

    [SPARK-25816][SQL] ResolveReferences works bottom-up on expressions

----


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22817: [SPARK-25816][SQL] Fix attribute resolution in nested ex...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/22817
  
    **[Test build #98040 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/98040/testReport)** for PR 22817 at commit [`790812e`](https://github.com/apache/spark/commit/790812e174fb5cd712fbda63297e01ea9d495526).


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22817: [SPARK-25816][SQL] Fix attribute resolution in nested ex...

Posted by peter-toth <gi...@git.apache.org>.
Github user peter-toth commented on the issue:

    https://github.com/apache/spark/pull/22817
  
    Thanks @dongjoon-hyun , @gatorsmile, @cloud-fan , @hvanhovell for the review.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request #22817: [SPARK-25816][SQL] Fix attribute resolution in ne...

Posted by peter-toth <gi...@git.apache.org>.
Github user peter-toth commented on a diff in the pull request:

    https://github.com/apache/spark/pull/22817#discussion_r228285647
  
    --- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/unresolved.scala ---
    @@ -407,7 +407,10 @@ case class ResolvedStar(expressions: Seq[NamedExpression]) extends Star with Une
      *                   can be key of Map, index of Array, field name of Struct.
      */
     case class UnresolvedExtractValue(child: Expression, extraction: Expression)
    -  extends UnaryExpression with Unevaluable {
    +  extends BinaryExpression with Unevaluable {
    --- End diff --
    
    if this change is not allowed then `children` we can override `children` instead


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22817: [SPARK-25816][SQL] Fix attribute resolution in nested ex...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/22817
  
    Merged build finished. Test PASSed.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22817: [SPARK-25816][SQL] Fix attribute resolution in nested ex...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/22817
  
    Merged build finished. Test PASSed.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22817: [SPARK-25816][SQL] ResolveReferences should work bottom-...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/22817
  
    **[Test build #97985 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/97985/testReport)** for PR 22817 at commit [`f62725f`](https://github.com/apache/spark/commit/f62725f5378f365c58b4b01f2a078e5e93176cda).
     * This patch **fails Spark unit tests**.
     * This patch merges cleanly.
     * This patch adds no public classes.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22817: [SPARK-25816][SQL] ResolveReferences should work bottom-...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/22817
  
    Can one of the admins verify this patch?


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request #22817: [SPARK-25816][SQL] Fix attribute resolution in ne...

Posted by cloud-fan <gi...@git.apache.org>.
Github user cloud-fan commented on a diff in the pull request:

    https://github.com/apache/spark/pull/22817#discussion_r228731805
  
    --- Diff: sql/core/src/test/scala/org/apache/spark/sql/DataFrameSuite.scala ---
    @@ -2578,4 +2578,12 @@ class DataFrameSuite extends QueryTest with SharedSQLContext {
             Row ("abc", 1))
         }
       }
    +
    +  test("SPARK-25816 ResolveReferences works with nested extractors") {
    +    val df0 = Seq((1, Map(1 -> "a")), (2, Map(2 -> "b"))).toDF("1", "2")
    +    val df1 = df0.select($"1".as("2"), $"2".as("1"))
    +    val df2 = df1.filter($"1"(map_keys($"1")(0)) > "a")
    --- End diff --
    
    +1, I think the test can be simplified
    ```
    val df = Seq((1, Map(1 -> "a")), (2, Map(2 -> "b"))).toDF("key", "map")
    checkAnswer(df.select($"map"($"key")), Row("a") :: Row("b") :: Nil)
    ```


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22817: [SPARK-25816][SQL] ResolveReferences should work bottom-...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/22817
  
    Test FAILed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/97985/
    Test FAILed.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22817: [SPARK-25816][SQL] ResolveReferences should work bottom-...

Posted by hvanhovell <gi...@git.apache.org>.
Github user hvanhovell commented on the issue:

    https://github.com/apache/spark/pull/22817
  
    @peter-toth what are you trying to fix here? Could you add this to the PR description?


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22817: [SPARK-25816][SQL] Fix attribute resolution in nested ex...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/22817
  
    **[Test build #98159 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/98159/testReport)** for PR 22817 at commit [`a5e9e4d`](https://github.com/apache/spark/commit/a5e9e4db95a5c809fda6bce852e743d1b7e97679).
     * This patch passes all tests.
     * This patch merges cleanly.
     * This patch adds no public classes.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22817: [SPARK-25816][SQL] Fix attribute resolution in nested ex...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/22817
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/98159/
    Test PASSed.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22817: [SPARK-25816][SQL] ResolveReferences should work bottom-...

Posted by peter-toth <gi...@git.apache.org>.
Github user peter-toth commented on the issue:

    https://github.com/apache/spark/pull/22817
  
    Thanks @gatorsmile , I thought the issue in SPARK-25816 and in the added UT is because the top-down. I thought that `UnresolvedExtractValue(child, fieldExpr) if child.resolved` could be resolved if we give a try to resolve child first so switched to bottom-up. But I see your point that maybe top-down is required in other cases.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22817: [SPARK-25816][SQL] ResolveReferences should work bottom-...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/22817
  
    Merged build finished. Test FAILed.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22817: [SPARK-25816][SQL] Fix attribute resolution in nested ex...

Posted by peter-toth <gi...@git.apache.org>.
Github user peter-toth commented on the issue:

    https://github.com/apache/spark/pull/22817
  
    @gatorsmile , I looked into this and it seems if we use `mapChildren` in `ResolveReferences` then `UnresolvedExtractValue` should define 2 children.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request #22817: [SPARK-25816][SQL] Fix attribute resolution in ne...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

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


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22817: [SPARK-25816][SQL] Fix attribute resolution in nested ex...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/22817
  
    **[Test build #98038 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/98038/testReport)** for PR 22817 at commit [`ac5c208`](https://github.com/apache/spark/commit/ac5c208b8670a472d85bf1e488a4ea89c4777534).
     * This patch passes all tests.
     * This patch merges cleanly.
     * This patch adds no public classes.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22817: [SPARK-25816][SQL] ResolveReferences should work bottom-...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/22817
  
    Can one of the admins verify this patch?


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22817: [SPARK-25816][SQL] ResolveReferences should work bottom-...

Posted by peter-toth <gi...@git.apache.org>.
Github user peter-toth commented on the issue:

    https://github.com/apache/spark/pull/22817
  
    So based on the UT results it seems that simply changing the resolution to bottom-up causes issues with `LambdaFunction`s in the current version of Spark.
    
    The issue seems to be a regression, and caused by this commit: https://github.com/apache/spark/commit/36b826f5d17ae7be89135cb2c43ff797f9e7fe48
    
    But reverting to bottom-up isn't simply viable in `ResolveReferences` since `LambdaFunction`s were introduced. The issue is that `ResolveReferences` have to be top-down and stop traversing the expression tree on an unbound `LambdaFunction` as a parameter attribute of a function can collide with an attribute from a DF. Such a colliding parameter attribute should not be resolved in `ResolveReferences` but in `ResolveLambdaVariables`. 


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22817: [SPARK-25816][SQL] Fix attribute resolution in nested ex...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/22817
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/98038/
    Test PASSed.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22817: [SPARK-25816][SQL] Fix attribute resolution in nested ex...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/22817
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/98040/
    Test PASSed.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22817: [SPARK-25816][SQL] Fix attribute resolution in nested ex...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/22817
  
    **[Test build #98040 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/98040/testReport)** for PR 22817 at commit [`790812e`](https://github.com/apache/spark/commit/790812e174fb5cd712fbda63297e01ea9d495526).
     * This patch passes all tests.
     * This patch merges cleanly.
     * This patch adds no public classes.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22817: [SPARK-25816][SQL] ResolveReferences should work bottom-...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/22817
  
    **[Test build #97985 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/97985/testReport)** for PR 22817 at commit [`f62725f`](https://github.com/apache/spark/commit/f62725f5378f365c58b4b01f2a078e5e93176cda).


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22817: [SPARK-25816][SQL] Fix attribute resolution in nested ex...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/22817
  
    **[Test build #98159 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/98159/testReport)** for PR 22817 at commit [`a5e9e4d`](https://github.com/apache/spark/commit/a5e9e4db95a5c809fda6bce852e743d1b7e97679).


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22817: [SPARK-25816][SQL] ResolveReferences should work bottom-...

Posted by hvanhovell <gi...@git.apache.org>.
Github user hvanhovell commented on the issue:

    https://github.com/apache/spark/pull/22817
  
    ok to test


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request #22817: [SPARK-25816][SQL] Fix attribute resolution in ne...

Posted by peter-toth <gi...@git.apache.org>.
Github user peter-toth commented on a diff in the pull request:

    https://github.com/apache/spark/pull/22817#discussion_r228737835
  
    --- Diff: sql/core/src/test/scala/org/apache/spark/sql/DataFrameSuite.scala ---
    @@ -2578,4 +2578,12 @@ class DataFrameSuite extends QueryTest with SharedSQLContext {
             Row ("abc", 1))
         }
       }
    +
    +  test("SPARK-25816 ResolveReferences works with nested extractors") {
    +    val df0 = Seq((1, Map(1 -> "a")), (2, Map(2 -> "b"))).toDF("1", "2")
    +    val df1 = df0.select($"1".as("2"), $"2".as("1"))
    +    val df2 = df1.filter($"1"(map_keys($"1")(0)) > "a")
    --- End diff --
    
    @cloud-fan unfortunately, that would be a bit too much of simplification.
    In your example `ResolveMissingReferences` after `ResolveReferences` is able to resolve the `extraction` correctly even without this PR. The issue comes up when we have another level of projection before the extractor.
    I simplified the example a bit though.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22817: [SPARK-25816][SQL] Fix attribute resolution in nested ex...

Posted by gatorsmile <gi...@git.apache.org>.
Github user gatorsmile commented on the issue:

    https://github.com/apache/spark/pull/22817
  
    The fix looks fine to me. cc @cloud-fan @hvanhovell 


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request #22817: [SPARK-25816][SQL] Fix attribute resolution in ne...

Posted by cloud-fan <gi...@git.apache.org>.
Github user cloud-fan commented on a diff in the pull request:

    https://github.com/apache/spark/pull/22817#discussion_r228731772
  
    --- Diff: sql/core/src/test/scala/org/apache/spark/sql/DataFrameSuite.scala ---
    @@ -2578,4 +2578,12 @@ class DataFrameSuite extends QueryTest with SharedSQLContext {
             Row ("abc", 1))
         }
       }
    +
    +  test("SPARK-25816 ResolveReferences works with nested extractors") {
    +    val df0 = Seq((1, Map(1 -> "a")), (2, Map(2 -> "b"))).toDF("1", "2")
    --- End diff --
    
    can we use a normal name like `i`, `j` instead of 1, 2?


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22817: [SPARK-25816][SQL] Fix attribute resolution in nested ex...

Posted by gatorsmile <gi...@git.apache.org>.
Github user gatorsmile commented on the issue:

    https://github.com/apache/spark/pull/22817
  
    Will take a look at this tonight. Thanks for reporting this!


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22817: [SPARK-25816][SQL] ResolveReferences should work bottom-...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/22817
  
    **[Test build #98038 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/98038/testReport)** for PR 22817 at commit [`ac5c208`](https://github.com/apache/spark/commit/ac5c208b8670a472d85bf1e488a4ea89c4777534).


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22817: [SPARK-25816][SQL] Fix attribute resolution in nested ex...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/22817
  
    Merged build finished. Test PASSed.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22817: [SPARK-25816][SQL] Fix attribute resolution in nested ex...

Posted by gatorsmile <gi...@git.apache.org>.
Github user gatorsmile commented on the issue:

    https://github.com/apache/spark/pull/22817
  
    LGTM
    
    Thanks! Merged to master/2.4/2.3


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22817: [SPARK-25816][SQL] ResolveReferences should work bottom-...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/22817
  
    Can one of the admins verify this patch?


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22817: [SPARK-25816][SQL] Fix attribute resolution in nested ex...

Posted by dongjoon-hyun <gi...@git.apache.org>.
Github user dongjoon-hyun commented on the issue:

    https://github.com/apache/spark/pull/22817
  
    Thank you, @gatorsmile !


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request #22817: [SPARK-25816][SQL] Fix attribute resolution in ne...

Posted by gatorsmile <gi...@git.apache.org>.
Github user gatorsmile commented on a diff in the pull request:

    https://github.com/apache/spark/pull/22817#discussion_r228729920
  
    --- Diff: sql/core/src/test/scala/org/apache/spark/sql/DataFrameSuite.scala ---
    @@ -2578,4 +2578,12 @@ class DataFrameSuite extends QueryTest with SharedSQLContext {
             Row ("abc", 1))
         }
       }
    +
    +  test("SPARK-25816 ResolveReferences works with nested extractors") {
    +    val df0 = Seq((1, Map(1 -> "a")), (2, Map(2 -> "b"))).toDF("1", "2")
    +    val df1 = df0.select($"1".as("2"), $"2".as("1"))
    +    val df2 = df1.filter($"1"(map_keys($"1")(0)) > "a")
    --- End diff --
    
    We are unable to resolve the expressions in `extraction` of `UnresolvedExtractValue`. We can simplify the expression in the `extraction`. For example, `df1.filter($"1"($"2") > "a")`.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22817: [SPARK-25816][SQL] ResolveReferences should work bottom-...

Posted by gatorsmile <gi...@git.apache.org>.
Github user gatorsmile commented on the issue:

    https://github.com/apache/spark/pull/22817
  
    This would not work, since we need both bottom-up and top-down. You would hit the test failure.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22817: [SPARK-25816][SQL] Fix attribute resolution in nested ex...

Posted by peter-toth <gi...@git.apache.org>.
Github user peter-toth commented on the issue:

    https://github.com/apache/spark/pull/22817
  
    @hvanhovell @gatorsmile I think this is regression from 2.2 to 2.3


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22817: [SPARK-25816][SQL] Fix attribute resolution in nested ex...

Posted by cloud-fan <gi...@git.apache.org>.
Github user cloud-fan commented on the issue:

    https://github.com/apache/spark/pull/22817
  
    RC5 will have this fix


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22817: [SPARK-25816][SQL] ResolveReferences should work bottom-...

Posted by peter-toth <gi...@git.apache.org>.
Github user peter-toth commented on the issue:

    https://github.com/apache/spark/pull/22817
  
    I will try to investigate a bit more come up with an other solution.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org