Repository navigation
Iceberg: ignore unparsable sort-order transform instead of aborting the server - #121687
alexey-milovidov merged 15 commits into
Conversation
|
Workflow [PR], commit [70d9691] Summary: ✅
AI ReviewSummaryThis PR changes Final Verdict✅ Approve LLVM Coverage ReportMeasured on commit 70d9691.
Changed lines: Changed C/C++ lines covered: 11/12 (91.67%) · Uncovered code |
…error lines In the private CI (`CH Inc sync`) the client output of the failing `SELECT` contains `BAD_ARGUMENTS` on two lines, so `grep -c` printed `2` instead of the expected `1` in every run of the test. The test only needs to check that the error is raised, so count at most one matching line. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
|
🕵 |
…ting the table An unknown transform in a table's sort order made every read and write fail with BAD_ARGUMENTS, which turns an optimization-level incompatibility into an unusable table. Iceberg sort orders are only an optimization hint, so return an empty KeyDescription: reads then treat the table as unsorted and writes skip sortBlockByKeyDescription. The regression test asserts that the table stays readable instead of checking for the error.
|
Implemented the suggested fallback: The regression test now asserts that the table stays readable without the sorted-read optimization (and that the server is alive) rather than checking for |
|
Status on e9bdc14: all stateless, functional, integration and stress checks are green, including the reworked |
…der-unparsed-transform
|
🕵 Merged current |
`parseTransformAndArgument` throws BAD_ARGUMENTS for spellings like `bucket]` or `truncate42]` (a `bucket`/`truncate` prefix, a trailing `]`, but no `[`). Those inputs rejected the whole table even though an Iceberg sort order is only an optimization hint. Catch that error code in `getSortingKeyDescriptionFromMetadata` and treat it the same as the `nullopt` case: drop the sort order and read the table as unsorted. Extend the regression test with the `bucket]` spelling so it covers the throwing path too, not only the `bucket[xyz]` nullopt path.
With use_iceberg_metadata_files_cache=1 (the default) the second icebergLocal() read can reuse the metadata.json cached by the first read because the cache key does not change on an in-place rewrite of the same file, so the throwing 'bucket]' path might never reach parseTransformAndArgument. Disable the cache on both reads so the test really exercises the nullopt and the BAD_ARGUMENTS branches.
Extend 05237_iceberg_sort_order_unknown_transform: after rewriting metadata.json, recreate the table and INSERT a row, then read it back. IcebergStorageSink resolves the sort order through getSortingKeyDescriptionFromMetadata, so the write entrypoint must tolerate the dropped sort order the same way reads do.
Build profile diff (arm_release)Comparing ✅ No significant changes. Binary sizes
The official master build is compiled with Compile time of recompiled translation units7 translation units recompiled, 16 s compile time in total, 7 of them have a recent master baseline. |
Recreating the `IcebergLocal` table over the path that already holds Iceberg metadata throws `TABLE_ALREADY_EXISTS`, so the write-path part of the test failed in every run. `IcebergStorageSink` re-reads the latest metadata on each `INSERT`, so inserting into the still-attached table exercises the same `getSortingKeyDescriptionFromMetadata` call. Also pass `use_iceberg_metadata_files_cache` as a client option, because a trailing `SETTINGS` after inline `VALUES` data is parsed as data. https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=121687&sha=4686a70cd062c1eb96129f43bc5acc467f1b1539&name_0=PR ClickHouse#121687 Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…der-unparsed-transform
|
🕵 The new write-path part of |
|
All three already have fixes in progress:
|
|
🕵 The merge queue removed this PR on 2026-10-04 only because |
Backport #121687 to 26.9: Iceberg: ignore unparsable sort-order transform instead of aborting the server
Backport #121687 to 26.8: Iceberg: ignore unparsable sort-order transform instead of aborting the server
Backport #121687 to 26.7: Iceberg: ignore unparsable sort-order transform instead of aborting the server
Backport #121687 to 26.3: Iceberg: ignore unparsable sort-order transform instead of aborting the server
…rder transform instead of aborting the server
…rder transform instead of aborting the server
…rder transform instead of aborting the server
…rder transform instead of aborting the server
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Fix a server abort when reading an Iceberg table whose sort order names a transform ClickHouse cannot parse (e.g.
bucket[xyz]); ClickHouse now ignores that sort-order hint and keeps the table readable.Documentation entry for user-facing changes
Motivation / issue
Iceberg::getSortingKeyDescriptionFromMetadatastores thestd::optionalreturned byparseTransformAndArgumentand dereferences it unconditionally. For unsupported transforms and malformedtruncate[...]/bucket[...]arguments the parser returnsstd::nullopt, so a single badtransformstring inmetadata.jsonaborts the whole server during query analysis — before any data is read — and every retry/replica pointed at the same table crashes again.Fix
Check
has_value()on the parsed transform. If a sort-order field names a transform thatparseTransformAndArgumentcannot handle,getSortingKeyDescriptionFromMetadatareturns an emptyKeyDescription: an Iceberg sort order is only an optimization hint, so reads treat the table as unsorted (hasSortingKeyis false, no read-in-order optimization on a misdescribed order) and writes skipsortBlockByKeyDescription. An earlier revision threwBAD_ARGUMENTSinstead; that was replaced after review because it made everySELECT/DESCRIBE/INSERTon such a table fail.Regression test
tests/queries/0_stateless/05237_iceberg_sort_order_unknown_transform.shcreates anIcebergLocalv2 table withORDER BY icebergTruncate(3, x), inserts rows, rewrites the transform in the latestv*.metadata.jsontobucket[xyz], then asserts thatSELECT ... FROM icebergLocal(...)still returns the rows and that the server still answersSELECT 1.Verification
The change is one
has_value()guard plus the stateless test; the new test passes in CI.Workflow [PR]
Sync PR [sync-upstream/pr/121687]
Version info
26.10.1.1727-master(included in26.10and later)26.9.13.8,26.8.20.10,26.7.24.10,26.3.45.3