Skip to content

[python] Plan chunk-shuffled native reads with IndexedSplit - #10023

Merged
JingsongLi merged 5 commits into
apache:masterfrom
JingsongLi:codex/native-read-coverage-round3
Sep 21, 2026
Merged

JingsongLi merged 5 commits into
apache:masterfrom
JingsongLi:codex/native-read-coverage-round3

Conversation

@JingsongLi

@JingsongLi JingsongLi commented Sep 20, 2026

Copy link
Copy Markdown
Contributor

What changed

  • pass chunk-shuffle seed, live-row chunk size, and scan-level worker shard directly to the Rust table scan
  • deserialize native chunk plans through the standard Java-compatible IndexedSplit wire format
  • use IndexedSplit.row_ranges consistently in Python planning and reading
    • row-tracked and data-evolution tables: stable global row IDs
    • tables without row tracking: split-local physical positions over file order
  • expand deletion vectors into live-only ranges, making row_count and merged_row_count the exact sum of selected ranges
  • select the coordinate system from table options and map ranges to each file in RawFileSplitRead, including DV position remapping and multi-file chunk boundaries
  • remove the temporary native metadata facade and exact-count overrides from IndexedSplit / SlicedSplit
  • fall back to the complete Python planner when the installed binding does not expose native chunk planning

Coverage

The matrix covers append, row-tracked append, and data-evolution tables; all four Python/Rust planner-reader combinations; deletion vectors including fragmented alternating positions; multi-file chunk boundaries; null and non-null partitions; signed and large seeds; worker sharding; projection; partition filters; time travel; empty plans; incremental reads; and stable split serialization.

Dependency

Depends on apache/paimon-rust#890.

Verification

  • chunk-shuffle planner, reader mapping, and native chunk integration: 85 passed
  • all native-plan and native-reader tests: 360 passed, 128 subtests passed
  • split serialization, distribution, and temporal suites: 105 passed, 77 subtests passed
  • Rust binding read suite: 87 passed
  • PyTorch suite was not run locally because PyTorch is not installed

@JingsongLi JingsongLi changed the title [python] Plan chunk-shuffled reads natively [python] Plan chunk-shuffled native reads with IndexedSplit Sep 20, 2026

@leaves12138 leaves12138 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P2] Remove the now-unused SlicedSplit import to unblock Python CI

This PR removes the remaining SlicedSplit assertions from paimon-python/pypaimon/tests/native_plan_distribution_test.py, but leaves the import at line 35. The required lint step now fails with:

pypaimon/tests/native_plan_distribution_test.py:35:1: F401 'pypaimon.read.sliced_split.SlicedSplit' imported but unused

Reproduced locally with python -m flake8 --config=dev/cfg.ini pypaimon/tests/native_plan_distribution_test.py from paimon-python. The Python 3.10 CI job reports the same error: https://github.com/apache/paimon/actions/runs/35521350138/job/106105908581 . Please remove the unused import and rerun CI.

I am continuing paired-runtime correctness validation. Compatibility with intermediate, unreleased native split implementations is not being treated as a separate blocker.

@leaves12138 leaves12138 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM for the Python-side changes through fb79b66. The latest commit fixes the unused-import CI failure reported in my earlier review. I found no remaining blocking issue specific to this Python patch.

Validation with the actual companion #890 runtime (724d2d685b852519926e4fff181526c1efe7a421):

  • 543 targeted PyPaimon tests passed, covering native planning, chunk shuffling, DVs, split serialization, reading, distribution, and temporal reads.
  • 88 Rust Python-binding read tests passed.
  • After the final import-only commit, the 14 native-plan distribution tests and flake8 on all changed Python files passed.

This approval is scoped to this Python PR, not the Rust dependency: I separately reported a reproducible ordinary row-ID range-read regression on apache/paimon-rust#890, which should be fixed before the paired feature is released. Compatibility with intermediate, unpublished native split implementations is not a blocker for this review.

@leaves12138 leaves12138 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM at 154af1a, validated together with apache/paimon-rust#890 at 7596b12d00b531983ab932a7a2412f8ceca65e46.

The latest fix addresses the remaining mixed-runtime row-loss issue: row-tracked append chunk ranges are generated as global row IDs, and RawFileSplitRead maps them back to file-local physical positions before reading. Non-row-tracked tables retain split-local coordinates. The added cross-runtime regression test exercises both mixed directions with separate planner/reader configurations.

Local validation:

  • The original eight-case planner/reader matrix passes with complete row coverage.
  • 546 targeted PyPaimon tests and 89 Rust Python-binding read tests pass.
  • 18 additional mixed-runtime cases pass across append/data evolution, row tracking, deletion vectors, chunk sizes 1/3/5, worker assignment, partition-filter projection, and snapshot reads.
  • flake8 passes on all changed Python files.

No remaining blocking issue found. The GitHub Python CI matrix was still running when checked; this approval does not imply that remote CI has completed.

@JingsongLi JingsongLi closed this Sep 21, 2026
@JingsongLi JingsongLi reopened this Sep 21, 2026
@JingsongLi
JingsongLi merged commit 854c735 into apache:master Sep 21, 2026
20 of 28 checks passed
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.

2 participants