Skip to content

[java][python] Read Python-planned splits with the native reader - #10017

Merged
JingsongLi merged 7 commits into
apache:masterfrom
JingsongLi:codex/native-read-coverage-round2
Sep 20, 2026
Merged

JingsongLi merged 7 commits into
apache:masterfrom
JingsongLi:codex/native-read-coverage-round2

Conversation

@JingsongLi

@JingsongLi JingsongLi commented Sep 20, 2026

Copy link
Copy Markdown
Contributor

Purpose

Keep PyPaimon's Rust physical reader available when the scan must be planned in Python. This extends native coverage to Python-planned DataSplit and IndexedSplit inputs, including Data Evolution row ranges and query-authorization wrappers.

Uses the cross-language split deserializer merged in apache/paimon-rust#889. pypaimon-rust has not been released, so this intentionally targets that API without a legacy compatibility shim. Vortex native read remains out of scope.

Changes

  • implement a Java-compatible SplitSerializer v1 writer for Python DataSplit and IndexedSplit
  • serialize the current DataSplit v9 / DataFileMeta v21 layout, preserving stats, deletion vectors, row ranges, external paths, streaming/raw flags, and optional vector scores
  • bridge Python-planned splits through pypaimon_rust.datafusion.Split.deserialize before native reads; scores remain on the Python IndexedSplit while Rust receives the physical row ranges
  • attach the planned snapshot id to Python DataSplits so stable cross-language serialization is self-contained
  • align the Java and Python APIs on writeColsSequences / write_cols_sequences, while retaining _WRITE_COLS_SEQUENCES as the serialized field name
  • support native reads for homogeneous query-authorization splits with Python-equivalent ordering: authorization filter, shared LIMIT, masking, then public projection
  • widen native projection for authorization dependencies without exposing those columns to callers
  • preserve safe Python fallback for unsupported split wrappers, mixed authorization contexts, nested or MAP-key authorization, and authorization filters over BLOB payloads
  • preserve initial-stream visibility of uncompacted level-0 files by using the Python planner when Rust's full-snapshot batch semantics would hide them; incremental native planning remains enabled
  • harden split decoding against truncated, negative-count, malformed-array, inverted-range, oversized modified-UTF, and trailing-byte inputs
  • add real Python-plan-to-Rust-read integration coverage for ordinary, partitioned, Indexed/Data Evolution, authorization, streaming-batch, projection, parallelism, and fallback paths

Tests

  • native read, split serializer, and query authorization: 114 passed
  • real paired Rust-wheel native integration suite: 35 passed, including Python-planned and Indexed/Data Evolution reads
  • Rust-plan level filtering suite: 15 passed, with 24 native plans exercised
  • streaming and native incremental planning suites: 66 passed
  • native Python coverage group: 266 passed, plus 128 parameterized subtests
  • resolved-schema coverage group: 82 passed
  • non-Vortex Data Evolution group: 185 passed, 1 skipped, 10 deselected, plus 29 parameterized subtests
  • changed manifest round-trip test passed
  • Java DataFileMeta / Data Evolution / global-index tests: 57 passed
  • Flink serializer tests: 7 passed
  • Spark copy tests: 3 passed
  • python -m compileall -q pypaimon
  • project flake8 configuration passed on every changed Python file
  • paired Rust binding tests, clippy, and formatting are recorded in [python] Deserialize cross-language splits for native reads paimon-rust#889

@JingsongLi JingsongLi changed the title [python] Read Python-planned splits with the native reader [java][python] Read Python-planned splits with the native reader 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.

Reviewed through 5877a49. The latest commit forwards snapshot_id from SlicedSplit and adds regression coverage, resolving the test failure found during review. I found no remaining blocking issues in the reviewed changes.

Checked the Python-to-native split conversion and serialization, query-authorization fallback, initial streaming behavior, and metadata compatibility.

Validation:

  • 556 targeted Python tests passed with the real native runtime from apache/paimon-rust#889 (1cda72a4beacb94a835b45daedbfb338ac05fa86), including native chunk-shuffle and split-generator tests.
  • 195 targeted Java serializer, compatibility, manifest, and Data Evolution tests passed; the subsequent commits only change Python code/tests.
  • Changed Python files passed flake8, including the latest wrapper and test changes.

Remote CI is still running; this approval does not imply that all CI jobs have completed.

@JingsongLi
JingsongLi merged commit 10cf6eb into apache:master Sep 20, 2026
24 of 25 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