Repository navigation
Change the interface for Iceberg inserts with the catalog - #100334
Conversation
|
Workflow [PR], commit [b479af7] Summary: ❌
AI ReviewSummaryThis PR migrates Findings
Tests
ClickHouse Rules
Final Verdict
|
|
|
||
| #endif | ||
| #if USE_AVRO | ||
| if ((*settings)[DataLakeStorageSetting::storage_catalog_type].changed || (*settings)[DataLakeStorageSetting::storage_aws_access_key_id].changed) |
There was a problem hiding this comment.
storage_aws_access_key_id, but the exception text says storage_catalog_url is deprecated. As written, storage_catalog_url can still be provided without triggering this error, so a deprecated setting is silently ignored.
Please either:
- check
storage_catalog_urlhere (likely intended), or - update both the validation and message so they match the actual deprecated set.
|
|
||
| #endif | ||
| #if USE_AVRO | ||
| if ((*settings)[DataLakeStorageSetting::storage_catalog_type].changed || (*settings)[DataLakeStorageSetting::storage_aws_access_key_id].changed) |
There was a problem hiding this comment.
❌ This validation is applied during storage construction for both CREATE and ATTACH paths (via configuration->getCatalog(...)). As a result, tables created in older versions with explicit storage_catalog_* settings can fail to attach after upgrade, which is a backward-incompatible startup/query regression.
Please gate this check so it does not reject existing metadata on ATTACH (or behind compatibility), and enforce it only for new CREATE statements.
415d00e to
d073d01
Compare
| @@ -151,23 +153,16 @@ def create_clickhouse_iceberg_database( | |||
| def create_clickhouse_iceberg_table( | |||
| started_cluster, node, database_name, table_name, schema, additional_settings={} | |||
There was a problem hiding this comment.
❌ This line is a Python syntax error: the f-string expression starts with {" , ...} due to nested double quotes, so the module fails to parse (f-string: expecting '}').
This breaks test collection for this integration suite.
Please build the suffix without nested quote collisions, for example:
settings_suffix = ""
if additional_settings:
settings_suffix = "SETTINGS " + ",".join(
k + "=" + repr(v) for k, v in additional_settings.items()
)|
|
||
| settings.update(additional_settings) | ||
| settings_suffix = "" if len(additional_settings) == 0 else f"SETTINGS {",".join((k+"="+repr(v) for k, v in additional_settings.items()))}" | ||
|
|
There was a problem hiding this comment.
❌ Same syntax issue as in test_database_iceberg: this f-string cannot be parsed because of nested double quotes inside the expression (f-string: expecting '}').
As written, the test_database_glue module also fails to import/collect.
Please construct settings_suffix without nested quote collisions (same fix pattern as above).
d073d01 to
b479af7
Compare
| 'minio_access_key', | ||
| 'minio_secret_key' | ||
| ) | ||
| SETTINGS |
There was a problem hiding this comment.
IcebergS3 tables with "necessary settings", but both examples now omit catalog settings entirely.
Please update the surrounding text to match the new interface (for example, explain that catalog routing now comes from the DataLakeCatalog database context) so users do not try obsolete storage_catalog_* settings.
LLVM Coverage Report
Changed lines: 87.18% (34/39) | lost baseline coverage: 12 line(s) · Uncovered code |
|
Hi @scanhex12 @divanik — while reviewing this PR I found the following:
Happy to discuss — close anything that's wrong or already addressed. |
The cherry-pick of ClickHouse#100334 incorrectly wired the cluster table-function branch of TableFunctionObjectStorage::executeImpl to call configuration->getCatalog(context, StorageID(getDatabaseName(), table_name)). ITableFunction::getDatabaseName returns the pseudo-database _table_function, which does not exist in DatabaseCatalog, so DataLakeConfiguration::getCatalog throws a LOGICAL_ERROR ("Database _table_function not found"). In ASan/debug builds this aborts the server, causing all subsequent tests in the shard to fail with "Connection refused". The non-cluster branch directly below already passes nullptr for the catalog argument. Align the cluster branch with the same behavior, which matches the upstream change_insert_interface branch. Addresses 33 failing test(s) in Integration tests (amd_asan, db disk, old analyzer, 2/6) on #1800. After this fix the still-failing set shrank from 33 -> 0. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
…solution in next commit) --- Original cherry-pick message follows: Merge pull request ClickHouse#100334 from ClickHouse/change_insert_interface Change the interface for Iceberg inserts with the catalog # Conflicts: # src/Storages/ObjectStorage/DataLakes/DataLakeConfiguration.h # tests/integration/test_database_glue/test.py # tests/integration/test_database_iceberg/test.py
…solution in next commit) --- Original cherry-pick message follows: Merge pull request ClickHouse#100334 from ClickHouse/change_insert_interface Change the interface for Iceberg inserts with the catalog # Conflicts: # src/Storages/ObjectStorage/DataLakes/DataLakeConfiguration.h # tests/integration/test_database_glue/test.py # tests/integration/test_database_iceberg/test.py
The cherry-pick of ClickHouse#100334 incorrectly wired the cluster table-function branch of TableFunctionObjectStorage::executeImpl to call configuration->getCatalog(context, StorageID(getDatabaseName(), table_name)). ITableFunction::getDatabaseName returns the pseudo-database _table_function, which does not exist in DatabaseCatalog, so DataLakeConfiguration::getCatalog throws a LOGICAL_ERROR ("Database _table_function not found"). In ASan/debug builds this aborts the server, causing all subsequent tests in the shard to fail with "Connection refused". The non-cluster branch directly below already passes nullptr for the catalog argument. Align the cluster branch with the same behavior, which matches the upstream change_insert_interface branch. Addresses 33 failing test(s) in Integration tests (amd_asan, db disk, old analyzer, 2/6) on #1800. After this fix the still-failing set shrank from 33 -> 0. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Condense the explanation at the DataLakeConfiguration::getCatalog return-nullptr site to two brief points: why a missing associated DataLake database is a valid state, and how callers treat the null catalog. The full context (stress-test fault injection, ClickHouse#100334 regression) lives in the PR description. Co-Authored-By: Claude Opus 4.8 <[email protected]>
… parent DB is missing `DataLakeConfiguration::getCatalog` (introduced by ClickHouse#100334) looked up the parent database in `DatabaseCatalog` and threw `LOGICAL_ERROR` ("Database X not found") when `tryGetDatabase` returned `nullptr`. That assertion is wrong: a missing database here is a transient runtime state, not a logical-invariant violation. Concretely it can fire during async metadata loading after a server restart (`AsyncLoader::worker` -> `DatabaseOrdinary::loadTableFromMetadata` -> `createStorageObjectStorage` -> `getCatalog`) when an unrelated table-load job in the same database has just thrown (for instance because of `cannot_allocate_thread_fault_injection_probability`) and the database has been detached as a result. Stress tests with thread-allocation fault injection have been hitting this LOGICAL_ERROR sporadically: `STID 2377-2a78`, 3 distinct unrelated PRs over 90 days (PR ClickHouse#98472 on 2026-04-09, PR ClickHouse#100958 on 2026-04-12, PR ClickHouse#102804 on 2026-04-30 - none of which touch this code or its callers). Production stack from PR ClickHouse#102804 stress-test (amd_debug): ``` 2026.04.30 05:17:39.895829 [ 6955 ] AsyncLoader::worker: Code: 439. DB::Exception: Cannot schedule a task: fault injected (...): Cannot attach table `test_1`.`test_max_size_drop` from metadata file ... 2026.04.30 05:17:40.099425 [ 6998 ] {} <Fatal> : Logical error: 'Database test_1 not found'. [stack: DataLakeConfiguration::getCatalog -> createStorageObjectStorage -> registerStorageIceberg -> StorageFactory::get -> createTableFromAST -> DatabaseOrdinary::loadTableFromMetadata -> AsyncLoader::worker] ``` Fix: combine the two null-checks. `dynamic_pointer_cast` already returns `nullptr` for a null input, so the function naturally returns `nullptr` both for "DB not registered" and "DB is not `DataLakeCatalog`" - the same response either way. This matches the behaviour of `getCatalog` before ClickHouse#100334, restores backward compatibility for `Iceberg` engine tables hosted in regular `Atomic`/`Ordinary` databases, and removes the spurious LOGICAL_ERROR signal from stress-test reports without changing behaviour for the supported `DataLakeCatalog` -> `Iceberg` path. Local verification (debug build): - Compiles, server starts. - `CREATE TABLE iceberg_t ENGINE = IcebergLocal(...)` inside a regular `Atomic` database succeeds, DETACH/ATTACH database cycle succeeds, server restart with `async_load_databases=1` reloads the table without LOGICAL_ERROR. Report: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=102804&sha=40e4eba7d14b8588106464e81b911e8de7a45dc6&name_0=PR&name_1=Stress%20test%20%28amd_debug%29 Co-Authored-By: Claude Opus 4.7 <[email protected]>
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Change the interface for Iceberg inserts with the catalog.
Deprecate settings: storage_catalog_type, storage_aws_access_key_id, etc.
Documentation entry for user-facing changes
Version info
26.4.1.647