Repository navigation
Conversation
`getMetadataFileAndVersion` threw `Bad metadata file name` for any name other than `v<N>.metadata.json`, `v<N>-<uuid>.metadata.json` or `<N>-<uuid>.metadata.json`, and every resolver of the current metadata file goes through it: the explicit `iceberg_metadata_file_path` (where a catalog's pointer also lands), the `version-hint.text` branch and the catalog-less listing. Iceberg does not restrict metadata file names (duckdb-iceberg fixtures use `vfinal.metadata.json`, `decimal_max_precision.metadata.json`, ...), so a valid file could not be read even when named explicitly, and one such file in `metadata/` failed the table. Name parsing is now separate from file selection, following Iceberg Java: - `tryGetMetadataFileVersion` keeps the old accept set and returns nothing where the old code threw; `getMetadataFileAndVersion` gives such a name version -1, so the next commit is version 0 (`BaseMetastoreTableOperations.parseVersion`); - readers listing by version (also with `iceberg_metadata_table_uuid`) skip it (`HadoopTableOperations.findVersion`), readers ranking by `last-updated-ms` keep it, and when only such files exist a dedicated FILE_DOESNT_EXIST names one of them and both settings that read them; - `ignore_metadata_pointer_overrides` callers (catalog-less writes and destructive operations) refuse such a table, as before, with a message that names the file: rooting a commit on the highest `v<N>` while an unversioned file may hold a newer state would drop that state, and `remove_orphan_files` would delete the file. 04061 keeps its three queries; the names are read now, so they fail on the missing object (S3_ERROR) instead of on the name, and a regressed parser would still print STD_EXCEPTION. Closes ClickHouse#129988 Co-Authored-By: Claude Opus 5.5 <[email protected]>
With `iceberg_use_version_hint = 1` and a hint naming a `v<N>` file, the catalog-less writer's listing keeps only `v<N>` names (the table's declared scheme, as on master), so an unversioned name never reaches the refusal and the write succeeds. The docs sentence saying such writes refuse to run was therefore false in that configuration; drop it and keep only the reader bullet. Co-Authored-By: Claude Opus 5.5 <[email protected]>
A pointer (`iceberg_metadata_file_path`, the version hint or a catalog path) to a name the temporary-file rule matches, such as `<uuid>.metadata.json` or a name without a `.`, is still refused, as on master. Only names that merely lack a version number are now accepted, so scope the docs bullet to what the listing does when reading and drop the "any name" sentence. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Remove a comment above the unversioned-name check that restated the exception message. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Internal second-model review (click to expand)
|
Pre-PR validation gate (click to expand)
Session id: cron:clickhouse-impl-slot-5:20261107-234300 |
|
cc @scanhex12 @alesapin, could you review this and add the |
|
Workflow [PR], commit [6ee9662] Summary: ✅
AI ReviewSummaryThe PR allows explicitly selected Iceberg metadata files without a parseable filename version, skips them during version-based discovery, and includes them during timestamp-based discovery. The new regression test covers explicit paths, listing policies, UUID selection, version hints, and refusal of catalog-less writes. No actionable findings. Consumers of the new
Missing context / blind spots
Final VerdictStatus: ✅ Approve |
CI finish ledger - 1be292fEvery failure below has an owner: a fixing PR (mine or external), or a full-effort fix task
The other CIDB Session id: cron:our-pr-ci-monitor:20261108-073004 |
…-metadata-file-name Conflict in Iceberg/Utils.cpp: master counts temporary candidates in the metadata listing and gave MetadataFileWithInfo a fourth field; kept both. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Build profile diff (arm_release)Comparing ✅ No significant changes. Binary sizes
The official master build is compiled with Compile time of recompiled translation units9 translation units recompiled, 41 s compile time in total, 9 of them have a recent master baseline. |
Closes: #129988
Related: #130010
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Iceberg metadata files whose names are not
v<N>.metadata.json,v<N>-<uuid>.metadata.jsonor<N>-<uuid>.metadata.jsonwere rejected withBad metadata file name. Now such a file is read wheniceberg_metadata_file_path,version-hint.textor a catalog names it, and the search for the latest metadata file skips it instead of failing the table (or ranks it bylast-updated-mswithiceberg_recent_metadata_file_by_last_updated_ms_field). Closes #129988.Description
On 26.10.2.103,
icebergLocal(..., SETTINGS iceberg_metadata_file_path = 'metadata/vfinal.metadata.json')fails withBAD_ARGUMENTSalthough the setting is documented to read this exact path and Iceberg does not restrict metadata file names (duckdb-iceberg fixtures usevfinal.metadata.json,decimal_max_precision.metadata.json, ...). One such file inmetadata/also made a catalog-less table unreadable.Root cause:
getMetadataFileAndVersionthrew for any name without a version, and every resolver calls it (explicit path and catalog pointer, version hint, listing).Change:
parseVersion;HadoopTableOperationsdoes, keeps them when ranking bylast-updated-ms, and when only such files exist, the error names them and both settings that read them;INSERT,ALTER,OPTIMIZE,expire_snapshots,remove_orphan_files, ...) keep failing exactly where they failed on the name before, now with a message naming the file.Validation: new
05568_iceberg_unversioned_metadata_file_name(fails on master, 50/50 randomized with the fix);04061keeps its queries, which now fail on the missing object (S3_ERROR) instead of on the name. The issue's owncount()repro now passes the name and stops at the separatecurrent-snapshot-id> Int64 overflow listed in #130010.🤖 Generated with Claude Code
Workflow [PR]
Sync PR [sync-upstream/pr/130070]