amaliujia commented on code in PR #38642:
URL: https://github.com/apache/spark/pull/38642#discussion_r1022037157


##########
python/pyspark/sql/tests/connect/test_connect_basic.py:
##########
@@ -207,6 +208,18 @@ def test_range(self):
             .equals(self.spark.range(start=0, end=10, step=3, 
numPartitions=2).toPandas())
         )
 
+    def test_create_global_temp_view(self):
+        # SPARK-41127: test global temp view creation.
+        with self.tempView("view_1"):
+            self.connect.sql("SELECT 1 AS X LIMIT 
0").createGlobalTempView("view_1")
+            self.connect.sql("SELECT 2 AS X LIMIT 
1").createOrReplaceGlobalTempView("view_1")
+            
self.assertTrue(self.spark.catalog.tableExists("global_temp.view_1"))
+
+            # Test when creating a view which is alreayd exists but
+            
self.assertTrue(self.spark.catalog.tableExists("global_temp.view_1"))
+            with self.assertRaises(_MultiThreadedRendezvous):

Review Comment:
   @grundprinzip yes! It is much better to use `grpc.RpcError` for readability. 



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

To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


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

Reply via email to