dongjoon-hyun commented on a change in pull request #25053: [SPARK-28252][SQL] 
local/global temp views should not accept duplicate column names
URL: https://github.com/apache/spark/pull/25053#discussion_r300517348
 
 

 ##########
 File path: 
sql/core/src/test/scala/org/apache/spark/sql/execution/GlobalTempViewSuite.scala
 ##########
 @@ -170,4 +170,14 @@ class GlobalTempViewSuite extends QueryTest with 
SharedSQLContext {
         isTemporary = true).toString)
     }
   }
+
+  test("Create global temp view with duplicate column name") {
+    withGlobalTempView("src") {
+      val e = intercept[AnalysisException]{
+        sql("CREATE GLOBAL TEMP VIEW src AS SELECT 1 as a, 2 as a")
+      }
+      assert(e.getMessage.contains("Found duplicate column(s)"))
+      sql("CREATE GLOBAL TEMP VIEW src AS SELECT 1 as a, 2 as b")
+    }
+  }
 
 Review comment:
   Could you update `org.apache.spark.sql.hive.ErrorPositionSuite`, too?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to