Skip to content

[Data] Iceberg DSv2 [15/15]: Route reads of added and widened columns through Ray's Parquet reader - #68449

Draft
AarryaSaraf wants to merge 1 commit into
iceberg-opt-10-position-deletesfrom
iceberg-opt-11-evolved-columns
Draft

AarryaSaraf wants to merge 1 commit into
iceberg-opt-10-position-deletesfrom
iceberg-opt-11-evolved-columns

Conversation

@AarryaSaraf

@AarryaSaraf AarryaSaraf commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

Summary

The Parquet route now also takes columns whose type widened or that were added after a file was written. Ray's Parquet reader is given the current types, so it widens old values and reads a missing column as nulls, as ArrowScan does. Renamed columns and reused names still go to ArrowScan. 15 of 15 in the Iceberg DSv2 stack (#66181).

Before

[12/15] routes a read only when every column has the same field ID, name and type in every schema the table has had. Any evolution sends the whole read to ArrowScan, even a plain int to long widening.

After

Files: _internal/datasource_v2/formats/iceberg/iceberg_parquet_route.py, iceberg_file_reader.py.

  • A column qualifies when no schema the table has had renamed it or gave its name to another field ID, so a data file stores it under its name or not at all.
  • Its type may have widened along Iceberg's promotions: int to long, float to double, or a decimal's precision.
  • It may also have been added after older files were written, unless it has an initial default, which would have to be filled in instead of null.
  • The reader passes the current Arrow types of the read and filter columns to ParquetFileReader, which casts older files' values up and fills an absent column with nulls.

Data flow unchanged: more reads qualify for [12/15]'s route.

Subsystems

IO (formats/iceberg/).

Testing

pytest python/ray/data/tests/datasource/test_iceberg.py: 224 passed at this PR's head (pyarrow 24.0.0, PyIceberg 0.11.1). The new tests cover:

  • files written before a column was added, or before col_a went from int to long, take the route and read as ArrowScan does (nulls, widened values), with and without a filter;
  • the schema-change test from [12/15] now keeps only a rename and a dropped-and-re-added name on ArrowScan.

ruff 0.8.4 (default and --select I), black 22.10.0, pydoclint 0.9.1 and pyrefly 0.51.0 (CI's environment) are clean.

Not a duplicate: apart from this stack, no open PR moves read_iceberg to Datasource V2. I searched open PRs with "iceberg" in the title on 2026-11-21; the only other one, #68252, fixes Iceberg writes on actor pools.

AI assistance (Claude Code) was used. I have reviewed every changed line and ran the tests above locally.

Signed-off-by: Aarrya [email protected]

🤖 Generated with Claude Code

@AarryaSaraf
AarryaSaraf added this pull request to stack #68450 November 21, 2026 23:17
… Ray's Parquet reader

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Aarrya <[email protected]>
@AarryaSaraf
AarryaSaraf force-pushed the iceberg-opt-11-evolved-columns branch from c1a24e3 to 744383f Compare November 24, 2026 01:24
@AarryaSaraf AarryaSaraf changed the title [Data] Iceberg DSv2 [14/14]: Route reads of added and widened columns through Ray's Parquet reader [Data] Iceberg DSv2 [15/15]: Route reads of added and widened columns through Ray's Parquet reader Nov 24, 2026
@AarryaSaraf
AarryaSaraf removed this pull request from stack #68450 November 24, 2026 01:50
@AarryaSaraf
AarryaSaraf added this pull request to stack #68499 November 24, 2026 01:51

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant