Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,17 @@ class V2SessionCatalog(catalog: SessionCatalog)
new CaseInsensitiveStringMap(propertiesWithPath.asJava)
}

private def hasCustomSessionCatalog: Boolean = {
catalog.conf.contains(SQLConf.V2_SESSION_CATALOG_IMPLEMENTATION.key)
}

override def loadTable(ident: Identifier): Table = {
try {
val table = catalog.getTableMetadata(ident.asTableIdentifier)
if (table.provider.isDefined) {
// The custom session catalog may extend `DelegatingCatalogExtension` and rely on the returned
// table here. To avoid breaking it we do not resolve the table provider and still return
// `V1Table` if the custom session catalog is present.
if (table.provider.isDefined && !hasCustomSessionCatalog) {
val qualifiedTableName = QualifiedTableName(table.database, table.identifier.table)
// Check if the table is in the v1 table cache to skip the v2 table lookup.
if (catalog.getCachedTable(qualifiedTableName) != null) {
Expand Down