Skip to content
Open
Show file tree
Hide file tree
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 @@ -374,13 +374,17 @@ class AbstractDeltaCatalog extends DelegatingCatalogExtension
.map(_.loadTable(ident))
.getOrElse(super.loadTable(ident))

ServerSidePlannedTable.tryCreate(spark, ident, table, isUnityCatalog).foreach { sspt =>
return sspt
}

table match {
case v1: V1Table if DeltaTableUtils.isDeltaTable(v1.catalogTable) =>
loadCatalogTable(ident, v1.catalogTable)
// Server-side planning only applies to Delta tables. Attempt it here, inside the
// Delta-`V1Table` branch, rather than on every loaded table: a non-Delta table or a
// catalog-specific shape (e.g. Unity Catalog's `MetadataTable` wrapping a `ViewInfo`
// for a metric view) must flow through the `case o => o` fallthrough unchanged so the
// resolver can route it correctly. Capturing those in `ServerSidePlannedTable.tryCreate`
// would short-circuit view loading.
ServerSidePlannedTable
.tryCreate(spark, ident, table, isUnityCatalog)
.getOrElse(loadCatalogTable(ident, v1.catalogTable))
case o => o
}
} catch {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class ServerSidePlannedTableSuite extends QueryTest with DeltaSQLCommandTest {
name STRING,
value INT,
a STRUCT<`b.c`: STRING>
) USING parquet
) USING delta
""")
sql("""
INSERT INTO test_db.shared_test (id, name, value, a) VALUES
Expand Down Expand Up @@ -222,7 +222,7 @@ class ServerSidePlannedTableSuite extends QueryTest with DeltaSQLCommandTest {
CREATE TABLE readonly_test (
id INT,
data STRING
) USING parquet
) USING delta
""")

// First insert WITHOUT server-side planning should succeed
Expand Down