Github user viirya commented on a diff in the pull request:
https://github.com/apache/spark/pull/17935#discussion_r116165542
--- 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://cwiki.apache.org/confluence/display/Hive/LanguageManual+SubQueries
> Hive supports subqueries only in the FROM clause (through Hive 0.12). The
subquery has to be given a name because every table in a FROM clause must have
a name.
Hive also requires an alias name.
---
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 [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]