Github user viirya commented on a diff in the pull request: https://github.com/apache/spark/pull/17935#discussion_r116165751 --- 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 -- https://docs.oracle.com/cd/E17952_01/mysql-5.1-en/from-clause-subqueries.html > The [AS] name clause is mandatory, because every table in a FROM clause must have a name. Any columns in the subquery select list must have unique names. Oracle also requires it.
--- 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