Skip to content

Commit 405b124

Browse files
committed
fix
1 parent 615b747 commit 405b124

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

externals/kyuubi-spark-sql-engine/src/main/scala/org/apache/kyuubi/engine/spark/util/SparkCatalogUtils.scala

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -163,16 +163,17 @@ object SparkCatalogUtils extends Logging {
163163
val namespaces = listNamespacesWithPattern(catalog, schemaPattern)
164164
catalog match {
165165
case builtin if builtin.name() == SESSION_CATALOG =>
166-
val catalog = spark.sessionState.catalog
167-
val databases = catalog.listDatabases(schemaPattern)
166+
val sessionCatalog = spark.sessionState.catalog
167+
val databases = sessionCatalog.listDatabases(schemaPattern)
168168

169169
def isMatchedTableType(tableTypes: Set[String], tableType: String): Boolean = {
170170
val typ = if (tableType.equalsIgnoreCase(VIEW)) VIEW else TABLE
171171
tableTypes.exists(typ.equalsIgnoreCase)
172172
}
173173

174174
databases.flatMap { db =>
175-
val identifiers = catalog.listTables(db, tablePattern, includeLocalTempViews = false)
175+
val identifiers =
176+
sessionCatalog.listTables(db, tablePattern, includeLocalTempViews = false)
176177
if (ignoreTableProperties) {
177178
identifiers.map {
178179
case TableIdentifier(
@@ -192,7 +193,7 @@ object SparkCatalogUtils extends Logging {
192193
null)
193194
}
194195
} else {
195-
catalog.getTablesByName(identifiers)
196+
sessionCatalog.getTablesByName(identifiers)
196197
.filter(t => isMatchedTableType(tableTypes, t.tableType.name)).map { t =>
197198
val typ = if (t.tableType.name == VIEW) VIEW else TABLE
198199
Row(

0 commit comments

Comments
 (0)