spark-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [spark] dongjoon-hyun commented on a change in pull request #26317: [SPARK-29628][SQL] Forcibly create a temporary view in CREATE VIEW if referencing a temporary view
Date Wed, 30 Oct 2019 16:26:39 GMT
dongjoon-hyun commented on a change in pull request #26317: [SPARK-29628][SQL] Forcibly create
a temporary view in CREATE VIEW if referencing a temporary view
URL: https://github.com/apache/spark/pull/26317#discussion_r340723648
 
 

 ##########
 File path: sql/core/src/test/scala/org/apache/spark/sql/execution/SQLViewSuite.scala
 ##########
 @@ -72,23 +72,16 @@ abstract class SQLViewSuite extends QueryTest with SQLTestUtils {
   }
 
   test("create a permanent view on a temp view") {
-    withView("jtv1") {
+    withTempView("jtv1") {
       withTempView("temp_jtv1") {
         withGlobalTempView("global_temp_jtv1") {
           sql("CREATE TEMPORARY VIEW temp_jtv1 AS SELECT * FROM jt WHERE id > 3")
-          var e = intercept[AnalysisException] {
-            sql("CREATE VIEW jtv1 AS SELECT * FROM temp_jtv1 WHERE id < 6")
-          }.getMessage
-          assert(e.contains("Not allowed to create a permanent view `jtv1` by " +
-            "referencing a temporary view `temp_jtv1`"))
+          sql("CREATE VIEW jtv1 AS SELECT * FROM temp_jtv1 WHERE id < 6")
 
           val globalTempDB = spark.sharedState.globalTempViewManager.database
           sql("CREATE GLOBAL TEMP VIEW global_temp_jtv1 AS SELECT * FROM jt WHERE id >
0")
-          e = intercept[AnalysisException] {
-            sql(s"CREATE VIEW jtv1 AS SELECT * FROM $globalTempDB.global_temp_jtv1 WHERE
id < 6")
-          }.getMessage
-          assert(e.contains(s"Not allowed to create a permanent view `jtv1` by referencing
" +
-            s"a temporary view `global_temp`.`global_temp_jtv1`"))
+          sql(s"CREATE VIEW jtv2 AS SELECT * FROM $globalTempDB.global_temp_jtv1 WHERE id
< 6")
+
 
 Review comment:
   LEt's remove this extra empty line.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

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


Mime
View raw message