imback82 commented on a change in pull request #26361: [SPARK-29630][SQL] 
Disallow creating a permanent view that references a temporary view in an 
expression
URL: https://github.com/apache/spark/pull/26361#discussion_r341799629
 
 

 ##########
 File path: 
sql/core/src/test/scala/org/apache/spark/sql/execution/SQLViewSuite.scala
 ##########
 @@ -94,6 +94,21 @@ abstract class SQLViewSuite extends QueryTest with 
SQLTestUtils {
     }
   }
 
+  test("create a permanent view on a temp view used inside an expression") {
+    withTable("base_table") {
+      withTempView("temp_view") {
+        sql("CREATE TABLE base_table (id int) USING parquet")
+        sql("CREATE TEMPORARY VIEW temp_view AS SELECT * FROM base_table")
+        val e = intercept[AnalysisException] {
+          sql("CREATE VIEW per_view AS SELECT * FROM base_table " +
+            "WHERE EXISTS (SELECT * FROM temp_view)")
 
 Review comment:
   I added few more as suggested. Please let me know if more are needed.

----------------------------------------------------------------
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