cloud-fan commented on code in PR #36983:
URL: https://github.com/apache/spark/pull/36983#discussion_r906998878
##########
sql/core/src/test/scala/org/apache/spark/sql/internal/CatalogSuite.scala:
##########
@@ -749,4 +749,22 @@ 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") {
+ val catalogName = "testcat"
+ val dbName = "default"
+ val tableName = "my_table"
+ val tableSchema = new StructType().add("i", "int")
+ val description = "this is a test table"
+ val fullTableName = "testcat.default.my_table"
+
+ createTable(tableName, dbName, catalogName,
classOf[FakeV2Provider].getName, tableSchema,
+ Map.empty[String, String], description)
+ spark.catalog.refreshTable(fullTableName)
+ assert(!spark.catalog.isCached(fullTableName))
+
+ spark.catalog.cacheTable(fullTableName)
+ spark.catalog.refreshTable(fullTableName)
+ assert(spark.catalog.isCached(fullTableName))
Review Comment:
We can use `spark.table(...).collect` to fetch the data. If we add/remove
files, we can simply check the number of rows.
--
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]