Repository navigation
Write split_offsets of Parquet data files to Iceberg manifests - #125619
Conversation
The Iceberg writer left `data_file.split_offsets` empty, so readers (ClickHouse bucket splitting, Trino, Spark) had to read the Parquet footer to split a file on row group boundaries. The Parquet output format now reports the `file_offset` of the row groups it wrote, and the manifest entry of every data file written by `INSERT` stores them. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Workflow [PR], commit [6962e76] Summary: ✅
AI ReviewSummaryThe PR exports Parquet row group offsets and writes them into Iceberg manifests for Findings
Tests
Final VerdictStatus: |
ClickHouse-written `split_offsets`, as Spark reads them from the `files` metadata table, must be the starting positions of the row groups by the rule of `iceberg-java` (the dictionary page or the first data page of the first column). For a file written by Spark, ClickHouse must see the same row group offsets that Spark stored in the manifest. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
|
||
| if (per_file_fresh_statistics && effective_statistics && !effective_statistics->getSplitOffsets().empty() | ||
| && data_file.hasField(Iceberg::f_split_offsets)) | ||
| { |
There was a problem hiding this comment.
split_offsets for callers that pass per_file_fresh_statistics, i.e. the fresh INSERT path.
The other manifest-generation paths still go through different carriers and will silently lose the field:
Compaction.cpprebuilds manifests fromper_file_statistics, butDataFileColumnStatisticshas nosplit_offsetsmember.Mutations.cppwrites one-file manifests fromdata_file_statisticsand never passesper_file_fresh_statisticshere.
So a file written by this PR drops back to split_offsets = null as soon as ClickHouse rewrites its manifest, and update-generated Parquet data files never get the new metadata. Can we thread split_offsets through those paths before landing this?
- Iceberg tables no longer accept `UInt64` columns; use `Int64` in `05395`. - `DataFile.splitOffsets` of `iceberg-java` returns null when the last offset is not less than the file size, and a projection of the `files` metadata table without `file_size_in_bytes` leaves the size at 0, so Spark showed no offsets. Select `file_size_in_bytes` as well. - The local uploader passes a file in the arguments of `docker exec`; make the file written by Spark small enough for it. CI report: https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=125619&sha=225d04a7e94bda552913c9eace3b492532ce8893&name_0=PR PR: #125619 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 units133 translation units recompiled, 959 s compile time in total, 133 of them have a recent master baseline. |
`05395_iceberg_write_split_offsets` hardcoded 10 row groups, but the Parquet writer forms row groups from incoming chunks, so a randomized `max_block_size` (e.g. 8072) produces 9. Check that there are several row groups and that `split_offsets` match their offsets instead. `test_spark_split_offsets_match_clickhouse_row_groups` queried the `files` metadata table as `<table>.files`, which Spark resolves as a table `files` in a database named after the table. Qualify it as `spark_catalog.default.<table>.files`. CI report: https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=125619&sha=latest&name_0=PR PR: #125619 Co-Authored-By: Claude Opus 5.5 <[email protected]>
The Iceberg writer left
data_file.split_offsetsempty, so readers (ClickHouse bucket splitting, Trino, Spark) had to read the Parquet footer to split a file on row group boundaries. The Parquet output format now reports thefile_offsetof the row groups it wrote, and the manifest entry of every data file written byINSERTstores them.Part 4: #124890
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Write
split_offsetsof Parquet data files to Iceberg manifestsWorkflow [PR]
Sync PR [sync-upstream/pr/125619]
Version info
26.11.1.738-master(included in26.11and later)