Github user dongjoon-hyun commented on a diff in the pull request:

    https://github.com/apache/spark/pull/18559#discussion_r126071223
  
    --- Diff: sql/core/src/test/scala/org/apache/spark/sql/SQLQuerySuite.scala 
---
    @@ -2638,4 +2638,17 @@ class SQLQuerySuite extends QueryTest with 
SharedSQLContext {
           }
         }
       }
    +
    +  test("SPARK-21335: support un-aliased subquery") {
    +    withTempView("v") {
    +      Seq(1 -> "a").toDF("i", "j").createOrReplaceTempView("v")
    +      checkAnswer(sql("SELECT i from (SELECT i FROM v)"), Row(1))
    +
    +      val e = intercept[AnalysisException](sql("SELECT v.i from (SELECT i 
FROM v)"))
    +      assert(e.message ==
    +        "cannot resolve '`v.i`' given input columns: 
[_auto_generated_subquery_name.i]")
    --- End diff --
    
    Then, the scope of breaking change is reduced into this kind of queries?
    
    ```scala
    scala> sc.version
    res0: String = 2.1.1
    
    scala> Seq(1 -> "a").toDF("i", "j").createOrReplaceTempView("v")
    
    scala> sql("SELECT v.i from (SELECT i FROM v)").show
    +---+
    |  i|
    +---+
    |  1|
    +---+
    ```


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