Repository navigation
Treat a namespace location that is not a URI as no location in DataLakeCatalog CREATE TABLE - #131238
Conversation
… table Databricks Unity Catalog reports `not_used` as the location of a schema with managed tables. `RestCatalog::getDefaultTableLocation` appends the table name to it, and `DatabaseDataLake::tryGetNewTableMetadata` passed `not_used/<table>` to `TableMetadata::setLocation`, which throws `NOT_IMPLEMENTED` "Unexpected location format" for anything without `://`. So `CREATE TABLE` without engine arguments in a `DataLakeCatalog` database over Databricks failed before any request reached the catalog. Treat such a location as unknown: `tryGetNewTableMetadata` returns `std::nullopt`, which every caller already handles. With an Iceberg engine the create goes to `createTableAtDefaultLocation` and the catalog chooses the location; without an engine the query fails with the existing "cannot tell where table has to be created" error. The check is in the consumer rather than in `RestCatalog`, because `OneLakeCatalog::getDefaultTableLocation` relies on the base returning a scheme-less location that it rewrites to `abfss://`. It uses the same `://` predicate as `setLocation`, so no location accepted before changes behaviour. Closes ClickHouse#131164 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Internal second-model review: adjudication log (click to expand)Pre-publication review by an independent model (engine: codex; 1 finding) plus my own review (2 nits).
Severity: ❌ blocker / Session id: cron:clickhouse-review-slot-10:20261113-091300 |
Pre-PR validation gate (click to expand)
Session id: cron:clickhouse-impl-slot-40:20261113-084000 |
|
Workflow [PR], commit [b18d234] Summary: ✅
AI ReviewSummaryReviewed #131238 at Consumers checked for the expanded
Missing context / blind spots
Final Verdict✅ Approve the code change. Normal CI validation remains required before merge. |
|
@groeneai I added One concern about the fix itself: on Please run the new integration test, fix the flow if it fails, and keep working on this PR until CI is fully green: investigate every failed check, fix what belongs to this change, and for unrelated failures link the existing flaky-test issue or master failure in a comment. |
|
I ran The
Server log of this run, with the table names shortened: After that the test inserts a row, reads it back, and checks that the catalog put
CI is running now. When it finishes I will post the ledger here and fix anything that comes from this change. |
Build profile diff (arm_release)Comparing ✅ No significant changes. Binary sizes
The official master build is compiled with Slowest function optimization changes (ThinLTO)Median per-function time ratio to the master baseline:
Compile time of recompiled translation units7 translation units recompiled, 22 s compile time in total, 7 of them have a recent master baseline. |
89b0921
Closes: #131164
Related: #125006
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
CREATE TABLEwithout engine arguments in aDataLakeCatalogdatabase now treats a namespace location that is not a URI, such as thenot_usedplaceholder Databricks Unity Catalog reports for a schema of managed tables, as no location, so the catalog chooses the table location. Previously the query failed withUnexpected location format(NOT_IMPLEMENTED). Closes #131164.Description
@ fm4v hit this on Databricks Unity (#131164):
CREATE TABLE db.`<schema>.t` (id Nullable(Int64)) ENGINE = IcebergS3in aDataLakeCatalogdatabase fails withUnexpected location format: not_used/<table>. (NOT_IMPLEMENTED).Databricks reports the location of a schema of managed tables as
not_used.RestCatalog::getDefaultTableLocationappends the table name, andDatabaseDataLake::tryGetNewTableMetadatapassednot_used/<table>toTableMetadata::setLocation, which throws for anything without://.tryGetNewTableMetadatanow returnsstd::nulloptfor such a location, the existing "catalog cannot tell the location" state that every caller already handles: with an Iceberg engine the create goes throughcreateTableAtDefaultLocation(#125006) and the catalog places the table; without an engine the query fails with the existingBAD_ARGUMENTS"cannot tell where table ... has to be created" error. It uses the same://predicate assetLocation, so no location accepted before changes behaviour. It is in the consumer, not inRestCatalog, becauseOneLakeCatalog::getDefaultTableLocationrewrites a scheme-less base location toabfss://.Not
Bug Fix: the success path exists only on master (#125006); on 26.10, which lacks it, the change would only replaceNOT_IMPLEMENTEDwith theBAD_ARGUMENTSerror.Validation: the new integration test creates a namespace with
location = not_usedin the existingtabulario/iceberg-restfixture, which returns it verbatim like Databricks. It fails on master with the issue's exact error and passes 50/50 with the fix. The rest oftest_database_iceberg(two backup tests need root; they fail the same way on master locally) and the create tests of the ClickHouse REST catalog and Lakekeeper modules pass. I had no access to Databricks, so the fixture reproduces only its namespace response.Workflow [PR]
Sync PR [sync-upstream/pr/131238]
Version info
26.11.1.2313-master(included in26.11and later)