amaliujia commented on code in PR #36983:
URL: https://github.com/apache/spark/pull/36983#discussion_r908847840
##########
sql/core/src/test/scala/org/apache/spark/sql/internal/CatalogSuite.scala:
##########
@@ -749,4 +750,25 @@ class CatalogSuite extends SharedSparkSession with
AnalysisTest with BeforeAndAf
assert(spark.catalog.currentCatalog().equals("spark_catalog"))
assert(spark.catalog.listCatalogs().collect().map(c => c.name).toSet ==
Set("testcat"))
}
+
+ test("SPARK-39583: Make RefreshTable be compatible with 3 layer namespace") {
+ withTempDir { dir =>
+ val tableName = "testcat.testdb.my_table"
+
+ sql("CREATE NAMESPACE testcat.testdb")
+ sql(s"""
+ | CREATE TABLE ${tableName}(col STRING) USING TEXT
+ | LOCATION '${dir.getAbsolutePath}'
+ |""".stripMargin)
+ sql(s"""INSERT INTO ${tableName} SELECT 'abc'""".stripMargin)
+ spark.catalog.cacheTable(tableName)
+ assert(spark.table(tableName).collect().length == 1)
+
+ FileUtils.deleteDirectory(dir)
Review Comment:
As of the result, the last assert
`assert(spark.table(tableName).collect().length == 0)` cannot pass: it is still
length = 1 meaning the data is not deleted.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]