dongjoon-hyun commented on a change in pull request #24221: [SPARK-27248][SQL] 
`refreshTable` should recreate cache with same cache name and storage level
URL: https://github.com/apache/spark/pull/24221#discussion_r285422373
 
 

 ##########
 File path: sql/core/src/test/scala/org/apache/spark/sql/CachedTableSuite.scala
 ##########
 @@ -985,4 +976,99 @@ class CachedTableSuite extends QueryTest with 
SQLTestUtils with SharedSQLContext
     val queryStats3 = query().queryExecution.optimizedPlan.stats.attributeStats
     assert(queryStats3.map(_._1.name).toSet === Set("c0", "v1", "v2"))
   }
+
+  test("SPARK-27248 refreshTable should recreate cache with same cache name 
and storage level") {
+
+    // This section tests when a table is cached with its qualified name but 
it is refreshed with
+    // its unqualified name.
+    withTempDatabase { db =>
+      withTempPath { path =>
+        withTable(s"$db.cachedTable") {
+          // Create table 'cachedTable' in temp db for testing purpose.
+          spark.catalog.createTable(
+            s"$db.cachedTable",
+            "PARQUET",
+            StructType(Array(StructField("key", StringType))),
+            Map("LOCATION" -> path.toURI.toString))
+
+          withCache(s"$db.cachedTable") {
+
 
 Review comment:
   ditto. 

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to