ostronaut commented on code in PR #49959:
URL: https://github.com/apache/spark/pull/49959#discussion_r1961631511


##########
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/ShowTablesExec.scala:
##########
@@ -40,17 +41,17 @@ case class ShowTablesExec(
     val tables = catalog.listTables(namespace.toArray)
     tables.map { table =>
       if (pattern.map(StringUtils.filterPattern(Seq(table.name()), 
_).nonEmpty).getOrElse(true)) {
-        rows += toCatalystRow(table.namespace().quoted, table.name(), 
isTempView(table))
+        rows += toCatalystRow(table.namespace().quoted, table.name(), 
isTempView(table, catalog))
       }
     }
 
     rows.toSeq
   }
 
-  private def isTempView(ident: Identifier): Boolean = {
-    catalog match {
-      case s: V2SessionCatalog => s.isTempView(ident)
-      case _ => false
-    }
+  private def isTempView(ident: Identifier, catalog: TableCatalog): Boolean = {
+    if (CatalogV2Util.isSessionCatalog(catalog)) {
+      session.sessionState.catalog
+        .isTempView((ident.namespace() :+ ident.name()).toImmutableArraySeq)

Review Comment:
   I've took it from existing implementation in default V2 catalog, let me 
replace it to `toArray`?



-- 
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-unsubscr...@spark.apache.org

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


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

Reply via email to