Repository navigation
Cherry pick #111786 to 26.6: Fix missing Iceberg field-ids in ClickHouse-written manifest and manifest-list files - #117303
Merged
Conversation
…nifest-field-ids-111763
The bundled avro-cpp JSON compiler drops the Iceberg field-id/element-id
attributes, so the schema it serialized into the avro.schema header of a
ClickHouse-written manifest / manifest-list omitted them. External readers
(PyIceberg, Spark) reject such a schema during scan planning ("Cannot convert
field, missing field-id"), while ClickHouse itself reads via the Iceberg
schema metadata key and did not notice.
generateManifestFile and generateManifestList now write the original
id-carrying JSON schema string as the avro.schema header. Encoded data is
unchanged; only the header schema now carries the spec field-ids it should.
Also derive the manifest partition-struct field-id from the persisted
partition spec instead of the hardcoded 1000+i: ClickHouse numbers partition
fields from 1001, and Iceberg projects partition values by field-id, so the
previously-invisible mismatch would break external readers once the id is
emitted. Legacy v1 specs that do not track partition field-ids fall back to
the sequential 1000+i default.
Closes: #111763
Co-Authored-By: Claude Opus 4.8 <[email protected]>
…eld-ids-111763 Fix missing Iceberg field-ids in ClickHouse-written manifest and manifest-list files
Two conflicts, both resolved toward 26.6's existing shape. src/Storages/ObjectStorage/DataLakes/Iceberg/IcebergWrites.cpp: master spells the extendSchemaForPartitions parameter 'const DataTypes &' where 26.6 spells the same type 'const std::vector<DataTypePtr> &' (also in IcebergWrites.h). Kept 26.6's spelling and added the new partition_spec_fields parameter. tests/integration/test_storage_iceberg_with_spark/test_writes_field_ids_spark_read.py: 26.6 does not have a10d171 ('Embed Iceberg field IDs in Avro and ORC data files') - verified by content, ORCBlockOutputFormat.cpp has no 'iceberg.id' on 26.6 - so the file does not exist there and the merge saw a modify/delete. Trimmed to the part this PR is about: the _avro_field_ids helper it depends on, _avro_metadata_schemas, and test_writes_manifest_field_ids_spark_read, copied verbatim from master. Matches the 26.7 cherry-pick (#117304) byte for byte. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Original pull-request #111786
Do not merge this PR manually
This pull-request is a first step of an automated backporting.
It contains changes similar to calling
git cherry-picklocally.If you intend to continue backporting the changes, then resolve all conflicts if any.
Otherwise, if you do not want to backport them, then just close this pull-request.
The check results does not matter at this step - you can safely ignore them.
Troubleshooting
If the conflicts were resolved in a wrong way
If this cherry-pick PR is completely screwed by a wrong conflicts resolution, and you want to recreate it:
pr-cherrypicklabel from the PRYou also need to check the Original pull-request for
pr-backports-createdlabel, and delete if it's presented thereThe PR source
The PR is created in the CI job