You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "cloud-fan (via GitHub)" <gi...@apache.org> on 2023/09/05 07:23:49 UTC

[GitHub] [spark] cloud-fan commented on a diff in pull request #42759: [SPARK-45039][SQL] Include full identifier in Storage tab

cloud-fan commented on code in PR #42759:
URL: https://github.com/apache/spark/pull/42759#discussion_r1315479553


##########
sql/core/src/main/scala/org/apache/spark/sql/execution/CacheManager.scala:
##########
@@ -117,12 +117,20 @@ class CacheManager extends Logging with AdaptiveSparkPlanHelper {
       logWarning("Asked to cache already cached data.")
     } else {
       val sessionWithConfigsOff = getOrCloneSessionWithConfigsOff(spark)
+      val completeTableName = tableName.map { table =>
+        import spark.sessionState.analyzer.CatalogAndIdentifier
+        spark.sessionState.sqlParser.parseMultipartIdentifier(table) match {
+          case Seq(_) if spark.catalog.getTable(table).isTemporary => table
+
+          case CatalogAndIdentifier(cat, ident) => s"${cat.name()}.${ident.toString}"

Review Comment:
   I think we should ask the caller side to pass in a fully qualified table name, instead of relying on the current catalog/namespace here.



-- 
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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org