[VL][Delta] Emit parquet field ids for UniForm tables on the native write path - #12957
Draft
malinjawi wants to merge 1 commit into
Draft
[VL][Delta] Emit parquet field ids for UniForm tables on the native write path#12957malinjawi wants to merge 1 commit into
malinjawi wants to merge 1 commit into
Conversation
|
Run Gluten Clickhouse CI on x86 |
malinjawi
force-pushed
the
split/delta-uniform-field-ids
branch
from
September 2, 2026 12:27
aed54b8 to
57ba768
Compare
|
Run Gluten Clickhouse CI on x86 |
…rite path A Delta table with IcebergCompatV2 is supposed to produce parquet files whose footers carry Iceberg-compatible field ids. Vanilla Delta arranges that in prepareWrite by installing DeltaParquetWriteSupport, but that only configures parquet-mr: when the write is offloaded, Velox writes the file directly and never consults it. The ids cannot leak in through Arrow either, since SparkArrowUtil.toArrowField drops StructField metadata. The result is a UniForm table whose data files carry no field ids at all, with no error and no fallback, while the IcebergConverter happily publishes Iceberg metadata over them. Read the ids Delta already recorded in the schema -- parquet.field.id for columns, parquet.field.nested.ids for the synthetic list-element, map-key and map-value nodes -- and pass them through the write options into ParquetWriterOptions. Gated on IcebergCompatV2, so nothing changes for other tables. Native Delta write is still experimental and off by default, so this closes a correctness hole ahead of that flag rather than fixing shipped behaviour.
malinjawi
force-pushed
the
split/delta-uniform-field-ids
branch
from
September 2, 2026 12:31
57ba768 to
dfcf2eb
Compare
|
Run Gluten Clickhouse CI on x86 |
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.
What changes were proposed in this pull request?
A Delta table with IcebergCompatV2 is supposed to produce parquet files whose footers carry Iceberg-compatible field ids. Vanilla Delta arranges that in
prepareWriteby installingDeltaParquetWriteSupport, but that only configures parquet-mr — when the write is offloaded, Velox writes the file directly and never consults it. The ids can't leak in through Arrow either, sinceSparkArrowUtil.toArrowFielddropsStructFieldmetadata.So a UniForm table written natively ends up with no field ids at all, with no error and no fallback, while the
IcebergConverterhappily publishes Iceberg metadata over those files.This reads the ids Delta already recorded in the schema —
parquet.field.idfor columns,parquet.field.nested.idsfor the synthetic list-element / map-key / map-value nodes — and passes them through the write options intoParquetWriterOptions. Gated onIcebergCompatV2, so nothing changes for other tables. Mirrored intosrc-delta40, where the helper is identical and symlinked.Native Delta write is still experimental and off by default, so this closes a correctness hole ahead of that flag rather than fixing shipped behaviour.
How was this patch tested?
GlutenDeltaParquetFieldIdSuitecovers the encoding.DeltaUniFormIcebergSuitewrites a partitioned table with nested struct/array/map columns, checks the footer with Delta's ownisParquetIcebergCompatV2, and reads the table back through Iceberg.Notes
Draft, and there's a known gap I'd rather flag than hide: the end-to-end suite drives the write with
INSERT INTO, whichOffloadDeltaCommanddoesn't offload, so it currently exercises the vanilla path and would pass with this change reverted. I'm reworking it onto an offloaded write with an explicit offload assertion before this is ready for review.Two open questions I'd welcome opinions on:
parquet.field.id" rather thanIcebergCompatV2. Delta enables field-id write for every session and writes the key for bothnameandidmapping, so the native writer is dropping ids for ordinary column-mapped tables too — the wider gate would cover IcebergCompatV1 and id mapping in the same guard.-1. Delta's owngetNestedFieldIdthrows instead, and Velox omits the annotation entirely for negative ids, so failing fast is probably the better behaviour.This is the write-side counterpart to #12884, which plumbs column mapping mode through scan splits.