You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by cloud-fan <gi...@git.apache.org> on 2017/05/12 05:04:25 UTC

[GitHub] spark pull request #17935: [SPARK-20690][SQL] Analyzer shouldn't add missing...

Github user cloud-fan commented on a diff in the pull request:

    https://github.com/apache/spark/pull/17935#discussion_r116153501
  
    --- Diff: sql/core/src/test/scala/org/apache/spark/sql/SubquerySuite.scala ---
    @@ -868,6 +868,29 @@ class SubquerySuite extends QueryTest with SharedSQLContext {
           Row(3, 3.0, 2, 3.0) :: Row(3, 3.0, 2, 3.0) :: Nil)
       }
     
    +  test("SPARK-20690: Do not add missing attributes through subqueries") {
    +    withTempView("onerow") {
    +      Seq(1).toDF("c1").createOrReplaceTempView("onerow")
    +
    +      val e = intercept[AnalysisException] {
    +        sql(
    +          """
    +            | select 1
    +            | from   (select 1 from onerow t1 LIMIT 1)
    --- End diff --
    
    I'm surprised we support this syntax, I think the FROM clause must have an alias.
    
    I checked with postgres, it will throw exception `subquery in FROM must have an alias`, can you check with other databases? Thanks!


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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