You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spark.apache.org by ya...@apache.org on 2024/08/06 11:05:40 UTC
(spark) branch branch-3.5 updated: [SPARK-49099][SQL][FOLLOWUP][3.5] recover tests in DDLSuite
This is an automated email from the ASF dual-hosted git repository.
yao pushed a commit to branch branch-3.5
in repository https://gitbox.apache.org/repos/asf/spark.git
The following commit(s) were added to refs/heads/branch-3.5 by this push:
new d13808c9d6cc [SPARK-49099][SQL][FOLLOWUP][3.5] recover tests in DDLSuite
d13808c9d6cc is described below
commit d13808c9d6cc88b514e1b7b9fdd642e0e6364f8d
Author: Wenchen Fan <we...@databricks.com>
AuthorDate: Tue Aug 6 19:05:25 2024 +0800
[SPARK-49099][SQL][FOLLOWUP][3.5] recover tests in DDLSuite
### What changes were proposed in this pull request?
This is a followup of https://github.com/apache/spark/pull/47592 to fix test failure during backport.
### Why are the changes needed?
recover CI
### Does this PR introduce _any_ user-facing change?
no
### How was this patch tested?
existing tests
### Was this patch authored or co-authored using generative AI tooling?
no
Closes #47630 from cloud-fan/fix.
Authored-by: Wenchen Fan <we...@databricks.com>
Signed-off-by: Kent Yao <ya...@apache.org>
---
.../test/scala/org/apache/spark/sql/execution/command/DDLSuite.scala | 5 +++--
.../scala/org/apache/spark/sql/hive/execution/HiveDDLSuite.scala | 1 +
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/command/DDLSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/command/DDLSuite.scala
index dea66bb09cfa..1e63350fdb43 100644
--- a/sql/core/src/test/scala/org/apache/spark/sql/execution/command/DDLSuite.scala
+++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/command/DDLSuite.scala
@@ -47,6 +47,7 @@ class InMemoryCatalogedDDLSuite extends DDLSuite with SharedSparkSession {
try {
// drop all databases, tables and functions after each test
spark.sessionState.catalog.reset()
+ spark.sessionState.catalogManager.reset()
} finally {
Utils.deleteRecursively(new File(spark.sessionState.conf.warehousePath))
super.afterEach()
@@ -1120,7 +1121,7 @@ abstract class DDLSuite extends QueryTest with DDLSuiteBase {
sql("ALTER TABLE dbx.tab1 SET TBLPROPERTIES ('andrew' = 'or14', 'kor' = 'bel')")
assert(getProps == Map("andrew" -> "or14", "kor" -> "bel"))
// set table properties without explicitly specifying database
- catalog.setCurrentDatabase("dbx")
+ spark.sessionState.catalogManager.setCurrentNamespace(Array("dbx"))
sql("ALTER TABLE tab1 SET TBLPROPERTIES ('kor' = 'belle', 'kar' = 'bol')")
assert(getProps == Map("andrew" -> "or14", "kor" -> "belle", "kar" -> "bol"))
// table to alter does not exist
@@ -1154,7 +1155,7 @@ abstract class DDLSuite extends QueryTest with DDLSuiteBase {
sql("ALTER TABLE dbx.tab1 UNSET TBLPROPERTIES ('j')")
assert(getProps == Map("p" -> "an", "c" -> "lan", "x" -> "y"))
// unset table properties without explicitly specifying database
- catalog.setCurrentDatabase("dbx")
+ spark.sessionState.catalogManager.setCurrentNamespace(Array("dbx"))
sql("ALTER TABLE tab1 UNSET TBLPROPERTIES ('p')")
assert(getProps == Map("c" -> "lan", "x" -> "y"))
// table to alter does not exist
diff --git a/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveDDLSuite.scala b/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveDDLSuite.scala
index 2c5e2956f5f8..2fad78e84f49 100644
--- a/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveDDLSuite.scala
+++ b/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveDDLSuite.scala
@@ -56,6 +56,7 @@ class HiveCatalogedDDLSuite extends DDLSuite with TestHiveSingleton with BeforeA
try {
// drop all databases, tables and functions after each test
spark.sessionState.catalog.reset()
+ spark.sessionState.catalogManager.reset()
} finally {
super.afterEach()
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@spark.apache.org
For additional commands, e-mail: commits-help@spark.apache.org