[python] Deserialize cross-language SplitSerializer v1 into pypaimon DataSplit#8523
Draft
XiaoHongbo-Hope wants to merge 9 commits into
Draft
[python] Deserialize cross-language SplitSerializer v1 into pypaimon DataSplit#8523XiaoHongbo-Hope wants to merge 9 commits into
XiaoHongbo-Hope wants to merge 9 commits into
Conversation
…DataSplit pypaimon_rust plans splits fast and serializes them as the cross-language SplitSerializer v1 binary (Split.serialize()). Add a pypaimon-side deserializer that rebuilds a DataSplit from that binary (DataSplit v8 frame: partition, bucket, bucket_path, DataFileMeta rows, deletion files), so pypaimon can read Rust-planned splits. Update rust_plan.py to consume serialize() instead of the removed to_dict(). Verified against the Java-generated golden.
Remove the now-unused ArrayType import (flake8). Add tests for the BinaryArray<string> decoder (inline and var-pointer elements) and for the IndexedSplit (type id 3) golden.
Raise a clear error on unexpected SplitSerializer/DataSplit version (only the magics were checked before). Document why min/max key + stats are left empty (planning-only; the append/data-evolution read path never uses them) and that modified-UTF8 decoding is BMP-only. Add a negative test for bad magic/version and fix the embedded IndexedSplit golden (had a corrupted version byte).
deserialize_split_v1 returned a plain DataSplit for an IndexedSplit (type 3), silently discarding its row_ranges/scores. The reader only restricts rows when the split is an IndexedSplit, so a Rust-planned ANN/row-id split would scan the whole file and return extra rows. Parse row_ranges + scores and return an IndexedSplit; the golden test now asserts them.
…ng contract Validate the IndexedSplit magic/version (were only skipped) with clear errors and a negative test. Document that predicate/projection/limit passed to rust_plan prune only at the split level; the caller must apply the equivalent pypaimon filter/projection/limit on the read for row-level correctness.
PK merge-on-read needs real min/max keys, which the deserializer leaves empty; fail loud instead of silently breaking the sort-merge. Add a guard test.
JingsongLi
reviewed
Jul 9, 2026
| return [by_name[name] for name in schema.partition_keys] | ||
|
|
||
|
|
||
| def rust_plan(table, table_identifier: str, catalog_options: dict, *, |
Contributor
There was a problem hiding this comment.
This is not called, can this PR not be introduced
rust_plan() had no in-tree caller and pulled in the optional pypaimon_rust dependency, so it was dead code. Per review, remove the bridge (and its PK-guard test) and keep only the self-contained, byte-exact SplitSerializer v1 deserializer. The bridge/consumer (rust_read) will land together with its actual caller.
df093f8 to
022aeac
Compare
Wire the rust-plan bridge into TableScan.plan() behind a config switch (scan.rust-plan.enabled, default off), so the SplitSerializer v1 deserializer has a real caller. When on, pypaimon_rust plans the splits and the pypaimon reader reads them. The predicate is not pushed to Rust, so partition pruning is re-applied on the pypaimon side and the reader's row filter/limit still apply. Primary-key tables are rejected; append tables only, experimental.
Contributor
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.
Purpose
Tests