Repository navigation
Field ids for data files in iceberg writes - #102362
Conversation
|
Workflow [PR], commit [a089160] Summary: ⏳
AI ReviewSummaryThis PR wires Iceberg Findings
Tests
Final VerdictStatus: Minimum required actions:
|
|
|
||
| for path in parquet_files: | ||
| schema_pq = pq.read_schema(path) | ||
| for field in schema_pq: |
There was a problem hiding this comment.
field_id values. Because this PR changes nested propagation for list/map/tuple paths (element, key, value), regressions in nested IDs would still pass.
Please add recursive assertions for nested fields (e.g. x.element, z.key, z.value, y.zip, y.foo) by walking the Parquet schema tree, not only for field in schema_pq.
There was a problem hiding this comment.
This is still unaddressed in the current revision.
test_writes_parquet_field_ids_complex_types still validates only top-level fields:
- loop is
for field in schema_pq(tests/integration/test_storage_iceberg_with_spark/test_writes.py:210) - expected ids map only contains
{\"x\", \"z\", \"y\"}(:197)
So regressions for nested IDs like x.element, z.key, z.value, y.zip, y.foo would still pass. Please add recursive schema checks for nested fields.
There was a problem hiding this comment.
This is still live in the current revision.
test_writes_parquet_field_ids_complex_types still only iterates top-level fields (for field in schema_pq) and only checks {"x", "z", "y"}. That cannot catch regressions in nested IDs (x.element, z.key, z.value, y.zip, y.foo) even though this PR changes nested propagation logic in PrepareForWrite.
Please walk the Parquet schema recursively and assert PARQUET:field_id for nested fields as well.
There was a problem hiding this comment.
This is still unresolved in the current code.
test_writes_parquet_field_ids_complex_types still checks only top-level fields:
- it iterates
for field in schema_pq(tests/integration/test_storage_iceberg_with_spark/test_writes.py:209), and - expected IDs include only
{"x", "z", "y"}(:197).
So regressions in nested IDs (x.element, z.key, z.value, y.zip, y.foo) would still pass. Please recurse through the Parquet schema tree and assert PARQUET:field_id for nested fields too.
ac23f6f to
a45ee5b
Compare
|
The |
2d62a47 to
7df75a0
Compare
| = FormatFactory::instance().getOutputFormat(write_format, *write_buffer, *sample_block, context, format_settings); | ||
| FormatFilterInfoPtr output_format_filter_info | ||
| = std::make_shared<FormatFilterInfo>(nullptr, context, column_mapper, nullptr, nullptr); | ||
| auto output_format = FormatFactory::instance().getOutputFormat( |
There was a problem hiding this comment.
field_id values during OPTIMIZE rewrites, but the added tests do not validate this path. Existing compaction tests in test_optimize.py only check row-level correctness/statistics, so dropping column_mapper wiring here would still pass CI.
Please add one focused integration assertion after OPTIMIZE that inspects a rewritten data Parquet file and checks PARQUET:field_id (ideally including one nested field).
There was a problem hiding this comment.
This point is still live in the current revision.
The newly added tests cover insert and update writes, but there is still no assertion for the compaction rewrite path (OPTIMIZE). If writeDataFiles in compaction drops FormatFilterInfo/column_mapper wiring in a future change, current tests would not catch it.
Please add one focused integration check that runs OPTIMIZE and verifies PARQUET:field_id in the rewritten data file (ideally including at least one nested field).
LLVM Coverage Report
Changed lines: 75.19% (97/129) | lost baseline coverage: 11 line(s) · Uncovered code |
a4cd0cf
…s with field ids `SELECT arr.u FROM <iceberg table>` with `arr Array(Tuple(u ..., v ...))` returned empty arrays since ClickHouse#102362 (26.5) when the Parquet data file has field ids, as files written by Spark, Flink, pyiceberg and ClickHouse itself do. The same held for `deep.s.p`, `aa.u`, `st.x.u` and any other tuple element reached through a list, also inside WHERE. ClickHouse#102362 made the Iceberg column mapper name the element of a list `arr.element` (and its fields `arr.element.u`), which the writer needs. To keep resolving the names of the element's fields in the Parquet reader, it replaced the reader-side name of the element node with `arr.element`. So the leaf was named `arr.element.u`, the requested `arr.u` was not found in the file, and it was filled with defaults. Keep the reader-side name (`arr.u`, as for files without field ids and in `file()`) and track the path in the column mapper's names separately, to strip the parent's prefix from the mapped names of the children.
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Field ids for data files in iceberg writes. Closes #102322
Documentation entry for user-facing changes
Version info
26.5.1.673