Skip to content

[Data] Iceberg DSv2 [13/15]: Pickle scan tasks without per-column statistics - #68447

Draft
AarryaSaraf wants to merge 1 commit into
iceberg-opt-8-parquet-routefrom
iceberg-opt-9-strip-task-stats
Draft

AarryaSaraf wants to merge 1 commit into
iceberg-opt-8-parquet-routefrom
iceberg-opt-9-strip-task-stats

Conversation

@AarryaSaraf

@AarryaSaraf AarryaSaraf commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Each manifest row's pickled FileScanTask now leaves out its data and delete files' per-column statistics. Listing has already used them, and the reader never reads them. They are most of a task's bytes. 13 of 15 in the Iceberg DSv2 stack (#66181).

Before

A task carries column_sizes, value_counts, null and NaN counts and lower and upper bounds for every column. A task for a one-row file of a 1,000-column table pickles to 85,746 B. Each attached position delete file adds 370 B. Those bytes travel through the bin packer and to every read task.

After

Files: _internal/datasource_v2/formats/iceberg/iceberg_manifest.py.

  • _without_column_stats copies the task's data file and delete files with those six fields set to None before pickling.
  • The same one-row task is now 516 B, and each position delete file 144 B (ray.cloudpickle, PyIceberg 0.11.1).
  • If a PyIceberg version lays out DataFile differently, the file is pickled with its stats.

Data flow unchanged: smaller rows.

Subsystems

IO (formats/iceberg/iceberg_manifest.py).

Testing

pytest python/ray/data/tests/datasource/test_iceberg.py: 220 passed at this PR's head (pyarrow 24.0.0, PyIceberg 0.11.1). The new test checks that the pickled task and its delete file come back without column sizes or bounds, while the planned ones keep theirs. 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
@AarryaSaraf
AarryaSaraf force-pushed the iceberg-opt-9-strip-task-stats branch from 5d23f43 to 7eaeedb Compare November 24, 2026 01:24
@AarryaSaraf AarryaSaraf changed the title [Data] Iceberg DSv2 [12/14]: Pickle scan tasks without per-column statistics [Data] Iceberg DSv2 [13/15]: Pickle scan tasks without per-column statistics 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