amaliujia commented on code in PR #36983:
URL: https://github.com/apache/spark/pull/36983#discussion_r908847390
##########
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:
It is wired that this dir is empty. I expected that after the `INSERT INTO`,
Spark will create data file under the text table location?
--
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]