Repository navigation
Conversation
|
Workflow [PR], commit [3f8ef51] Summary: ✅
AI ReviewSummaryThe PR implements Findings
Missing context / blind spots
Final Verdict |
| } | ||
| catch (const DB::HTTPException & e) | ||
| { | ||
| if (e.getHTTPStatus() != Poco::Net::HTTPResponse::HTTP_NOT_FOUND) |
There was a problem hiding this comment.
This 404 swallow is too broad for Unity. existsTable in this file already documents that the tables endpoint also returns 404 when the schema or catalog itself is missing, so returning false here regresses broken-namespace lookups into UNKNOWN_TABLE / “does not exist” instead of surfacing the real catalog error. Please mirror the existsTable logic here: on 404, call checkNamespaceExists(schema_name) before treating it as an absent table.
There was a problem hiding this comment.
I think the "schema does not exist" error message is very marginally better than the "table does not" error message and is not worth the extra request.
Manual testing against DatabricksCREATE DATABASE unity
ENGINE = DataLakeCatalog('https://dbc-xxxxx.cloud.databricks.com/api/2.1/unity-catalog')
SETTINGS catalog_type = 'unity', use_unity_catalog_v2 = 1,
warehouse = 'asya-test-catalog', catalog_credential = 'dapi...';Dropped three kinds of tables; in each case DROP TABLE unity.`default.ch_iceberg_2`; -- CH-created external Iceberg (IcebergS3)
DROP TABLE unity.`default.drop_managed`; -- Databricks-created managed Iceberg
DROP TABLE unity.`default.ch_created`; -- CH-created DeltaNonexistent table and schema: DROP TABLE unity.`default.nope`; -- UNKNOWN_TABLE: Table unity.`default.nope` does not exist
DROP TABLE IF EXISTS unity.`default.nope`; -- Ok.
DROP TABLE unity.`no_such_schema.t`; -- UNKNOWN_TABLE: Table unity.`no_such_schema.t` does not exist
DROP TABLE IF EXISTS unity.`no_such_schema.t`; -- Ok. |
| checkNamespaceExists(namespace_name); | ||
| } | ||
|
|
||
| void UnityV2Catalog::dropTable(const String & namespace_name, const String & table_name, bool /*delete_data*/) const |
There was a problem hiding this comment.
AFAIK this delete will drop the data, but we ignore delete_data flag, shouldn't we support it here?
There was a problem hiding this comment.
Good point, we should be more careful with the delete_data flag.
Unity supports both managed and external tables. It will drop the data for managed and leave it for external. I think, if possible, we should check if the table is managed or external, and then:
- If it's external, ignore delete_data.
- If it's managed and delete_data=true, continue.
- If it's managed and delete_data=false, throw. This is the S3 tables approach.
WDYT?
There was a problem hiding this comment.
Also, while trying to test the behavior, I discovered some bugs in the flag wiring. I'll fix them in #126110.
There was a problem hiding this comment.
Good point, we should be more careful with the
delete_dataflag.Unity supports both managed and external tables. It will drop the data for managed and leave it for external. I think, if possible, we should check if the table is managed or external, and then:
- If it's external, ignore delete_data.
- If it's managed and delete_data=true, continue.
- If it's managed and delete_data=false, throw. This is the S3 tables approach.
WDYT?
Sounds reasonable
|
|
||
| user = unique_name("v2_drop_user") | ||
| node.query(f"CREATE USER {user}") | ||
| assert "ACCESS_DENIED" in node.query_and_get_error( |
There was a problem hiding this comment.
Not sure that we should run drop without grants first, or there was a bug as well?
| LOG_DEBUG(log, "Unity table {} does not exist", full_table_name); | ||
| return false; | ||
| } | ||
| const Poco::JSON::Object::Ptr & object = json.extract<Poco::JSON::Object::Ptr>(); |
There was a problem hiding this comment.
Nit: 'const auto &' would be shorter
Build profile diff (arm_release)Comparing ✅ No significant changes. Binary sizes
The official master build is compiled with Object file sizes11 object files changed (+25.42 KiB total), 0 added.
719 more object files are built by the master warmup baseline only (it builds every object-file target, a pull request build only Compile time of recompiled translation units8 translation units recompiled, 30 s compile time in total, 8 of them have a recent master baseline. |
UnityV2Catalog now implements dropTable (ClickHouse#124481): for an external table it refuses `iceberg_delete_data_on_drop = 1` with SUPPORT_IS_DISABLED before sending anything, instead of the base ICatalog NOT_IMPLEMENTED. The file and row assertions are unchanged; a mutant that sends Unity down the client-side delete path still fails them. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Closes: #124438
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Support
DROP TABLEin theDataLakeCatalogdatabase engine with the Unity catalog v2.Workflow [PR]
Sync PR [sync-upstream/pr/124481]
Version info
26.11.1.379-master(included in26.11and later)