You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2020/11/12 01:02:49 UTC

[GitHub] [spark] ulysses-you commented on a change in pull request #29034: [SPARK-32219][SQL] Add SHOW CACHED TABLES Command

ulysses-you commented on a change in pull request #29034:
URL: https://github.com/apache/spark/pull/29034#discussion_r521751393



##########
File path: sql/core/src/main/scala/org/apache/spark/sql/execution/command/tables.scala
##########
@@ -863,7 +864,12 @@ case class ShowTablesCommand(
       // Show the information of tables.
       val tables =
         tableIdentifierPattern.map(catalog.listTables(db, _)).getOrElse(catalog.listTables(db))
-      tables.map { tableIdent =>
+      val filterCachedTables = if (showCached) {
+        tables.filter(table => sparkSession.catalog.isCached(table.quotedString))

Review comment:
       Based on current implementation of cache, we only cache the `LogicalPlan` without any metadata like `table name`. So here we list and filter the table one by one.




----------------------------------------------------------------
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:
users@infra.apache.org



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