imback82 commented on a change in pull request #30403:
URL: https://github.com/apache/spark/pull/30403#discussion_r531440623



##########
File path: 
sql/core/src/main/scala/org/apache/spark/sql/execution/command/cache.scala
##########
@@ -51,32 +54,35 @@ case class CacheTableCommand(
 
     if (storageLevelValue.nonEmpty) {
       sparkSession.catalog.cacheTable(
-        tableIdent.quotedString, 
StorageLevel.fromString(storageLevelValue.get))
+        tableName, StorageLevel.fromString(storageLevelValue.get))
     } else {
-      sparkSession.catalog.cacheTable(tableIdent.quotedString)
+      sparkSession.catalog.cacheTable(tableName)
     }
 
     if (!isLazy) {
       // Performs eager caching
-      sparkSession.table(tableIdent).count()
+      sparkSession.table(tableName).count()
     }
 
     Seq.empty[Row]
   }
 }
 
-
 case class UncacheTableCommand(
-    tableIdent: TableIdentifier,
+    multipartIdentifier: Seq[String],
     ifExists: Boolean) extends RunnableCommand {
 
   override def run(sparkSession: SparkSession): Seq[Row] = {
-    val tableId = tableIdent.quotedString
-    if (!ifExists || sparkSession.catalog.tableExists(tableId)) {

Review comment:
       Ah, I see your point.
   
   `CatalogImpl.cacheTable` already supports v2 tables since it resolves the 
table name by `sparkSession.table(tableName)`. But, I think 
`CatalogImpl.cacheTable`, `CatalogImpl.unCacheTable` should only support v1 
tables, and `CacheTableCommand` and `UncacheTableCommand` should go thru 
`sparkSession.sharedState.cacheManager`, right? I will update accordingly.




----------------------------------------------------------------
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]



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

Reply via email to