You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spark.apache.org by yu...@apache.org on 2023/03/06 00:10:57 UTC
[spark] branch master updated: [SPARK-42675][CONNECT][TESTS] Drop temp view after test `test temp view`
This is an automated email from the ASF dual-hosted git repository.
yumwang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/spark.git
The following commit(s) were added to refs/heads/master by this push:
new bfe61abc2c3 [SPARK-42675][CONNECT][TESTS] Drop temp view after test `test temp view`
bfe61abc2c3 is described below
commit bfe61abc2c3db554514237ef7b077225d9760f60
Author: yangjie01 <ya...@baidu.com>
AuthorDate: Mon Mar 6 08:10:38 2023 +0800
[SPARK-42675][CONNECT][TESTS] Drop temp view after test `test temp view`
### What changes were proposed in this pull request?
This pr just drop temp view after test which create by `test temp view` in `ClientE2ETestSuite`.
### Why are the changes needed?
Drop temp view after test to clean up resource.
### Does this PR introduce _any_ user-facing change?
No
### How was this patch tested?
Pass GitHub Actions
Closes #40285 from LuciferYang/drop-view.
Authored-by: yangjie01 <ya...@baidu.com>
Signed-off-by: Yuming Wang <yu...@ebay.com>
---
.../org/apache/spark/sql/ClientE2ETestSuite.scala | 21 +++++++++++++--------
1 file changed, 13 insertions(+), 8 deletions(-)
diff --git a/connector/connect/client/jvm/src/test/scala/org/apache/spark/sql/ClientE2ETestSuite.scala b/connector/connect/client/jvm/src/test/scala/org/apache/spark/sql/ClientE2ETestSuite.scala
index 5c35ef448be..0397995bba6 100644
--- a/connector/connect/client/jvm/src/test/scala/org/apache/spark/sql/ClientE2ETestSuite.scala
+++ b/connector/connect/client/jvm/src/test/scala/org/apache/spark/sql/ClientE2ETestSuite.scala
@@ -501,14 +501,19 @@ class ClientE2ETestSuite extends RemoteSparkSession {
}
test("test temp view") {
- spark.range(100).createTempView("test1")
- assert(spark.sql("SELECT * FROM test1").count() == 100)
- spark.range(1000).createOrReplaceTempView("test1")
- assert(spark.sql("SELECT * FROM test1").count() == 1000)
- spark.range(100).createGlobalTempView("view1")
- assert(spark.sql("SELECT * FROM global_temp.view1").count() == 100)
- spark.range(1000).createOrReplaceGlobalTempView("view1")
- assert(spark.sql("SELECT * FROM global_temp.view1").count() == 1000)
+ try {
+ spark.range(100).createTempView("test1")
+ assert(spark.sql("SELECT * FROM test1").count() == 100)
+ spark.range(1000).createOrReplaceTempView("test1")
+ assert(spark.sql("SELECT * FROM test1").count() == 1000)
+ spark.range(100).createGlobalTempView("view1")
+ assert(spark.sql("SELECT * FROM global_temp.view1").count() == 100)
+ spark.range(1000).createOrReplaceGlobalTempView("view1")
+ assert(spark.sql("SELECT * FROM global_temp.view1").count() == 1000)
+ } finally {
+ spark.sql("DROP VIEW IF EXISTS test1")
+ spark.sql("DROP VIEW IF EXISTS global_temp.view1")
+ }
}
test("version") {
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@spark.apache.org
For additional commands, e-mail: commits-help@spark.apache.org