From 405b12484c7d3287e760d0a62c14f027f81caab4 Mon Sep 17 00:00:00 2001 From: Cheng Pan Date: Thu, 25 Jan 2024 22:57:37 +0800 Subject: [PATCH] fix --- .../kyuubi/engine/spark/util/SparkCatalogUtils.scala | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/externals/kyuubi-spark-sql-engine/src/main/scala/org/apache/kyuubi/engine/spark/util/SparkCatalogUtils.scala b/externals/kyuubi-spark-sql-engine/src/main/scala/org/apache/kyuubi/engine/spark/util/SparkCatalogUtils.scala index e9797cbed3a..b47234f7f1e 100644 --- a/externals/kyuubi-spark-sql-engine/src/main/scala/org/apache/kyuubi/engine/spark/util/SparkCatalogUtils.scala +++ b/externals/kyuubi-spark-sql-engine/src/main/scala/org/apache/kyuubi/engine/spark/util/SparkCatalogUtils.scala @@ -163,8 +163,8 @@ object SparkCatalogUtils extends Logging { val namespaces = listNamespacesWithPattern(catalog, schemaPattern) catalog match { case builtin if builtin.name() == SESSION_CATALOG => - val catalog = spark.sessionState.catalog - val databases = catalog.listDatabases(schemaPattern) + val sessionCatalog = spark.sessionState.catalog + val databases = sessionCatalog.listDatabases(schemaPattern) def isMatchedTableType(tableTypes: Set[String], tableType: String): Boolean = { val typ = if (tableType.equalsIgnoreCase(VIEW)) VIEW else TABLE @@ -172,7 +172,8 @@ object SparkCatalogUtils extends Logging { } databases.flatMap { db => - val identifiers = catalog.listTables(db, tablePattern, includeLocalTempViews = false) + val identifiers = + sessionCatalog.listTables(db, tablePattern, includeLocalTempViews = false) if (ignoreTableProperties) { identifiers.map { case TableIdentifier( @@ -192,7 +193,7 @@ object SparkCatalogUtils extends Logging { null) } } else { - catalog.getTablesByName(identifiers) + sessionCatalog.getTablesByName(identifiers) .filter(t => isMatchedTableType(tableTypes, t.tableType.name)).map { t => val typ = if (t.tableType.name == VIEW) VIEW else TABLE Row(