Repository navigation
[python] Align native scan planning with Rust - #9825
Conversation
|
Re-open to trigger tests. |
leaves12138
left a comment
There was a problem hiding this comment.
Reviewed the production changes against the Java and Rust implementations, including incremental snapshot selection, append/PK/DE distribution, range intersections, limit placement, fallback gates, and DV read/write/abort paths.
Validation at eef6215 with a locally built pypaimon-rust 0.4.0 from 7fd9bab99f63a3860a72cd93f31b047f9f770f89: 162 focused tests passed; the expanded native-planning regression run passed 309 tests and exercised 233 native plans; the default Python-planning regression run passed 224 tests. Seven Vortex tests were skipped because the local interpreter is Python 3.10. These are targeted runs, not the full CI suite.
One reproducible interoperability issue remains in canonical bucket-local DV path resolution; details and reproduction are inline.
leaves12138
left a comment
There was a problem hiding this comment.
Re-reviewed the changes since eef6215, using Java as the authoritative format. The previously reported FLOAT and ordinary TIMESTAMP DV-path cases are fixed. I checked typed partition ordering, legacy formatting, floating-point directory fallback, explicit-path precedence and the new regressions.
At ead0e87, 214 focused tests passed with the Rust binding built from apache/paimon-rust#833. The expanded native-planning regression run passed 395 tests and exercised 233 native plans; seven Vortex tests were skipped because the local interpreter is Python 3.10. These are targeted runs rather than the full CI suite.
One remaining Java-interoperability issue is reproducible for TIMESTAMP_LTZ partition keys: both legacy modes retain a Python timezone suffix in the lookup path. I verified the Java paths with InternalRowPartitionComputer/PartitionPathUtils and reproduced FileNotFoundError in four independent whole-second/fractional DV-read cases. Details are inline. This finding concerns Java-produced paths, not compatibility with incorrect older Rust paths.
leaves12138
left a comment
There was a problem hiding this comment.
LGTM. Re-reviewed 10b5984866bf3e7e23fc2f47fc2dfae1554be7f2, including the changes since my previous review, with Java as the authoritative implementation.
The remaining LTZ issue is fixed: values are normalized to UTC fields for legacy names or to the process default timezone for non-legacy names, without an offset suffix, and the declared timestamp precision is retained. Both LTZ spellings are handled. The earlier FLOAT and ordinary TIMESTAMP fixes remain covered, and apache/paimon-rust#834 is now merged.
Independent validation using Python 3.10 and a Rust wheel built from apache/paimon-rust#834 (2cdab049):
- All four original LTZ failure reproductions now pass; all 131 DV-path tests pass.
- Expanded native-planning regression: 331 passed, with 158 tracked native plans. The corresponding Python-planning run passed 226 tests, with native-only cases deselected.
- 216 path comparisons against Java
InternalRowPartitionComputerpassed across UTC, Asia/Shanghai, and America/New_York, covering alias/canonical types, naive/UTC/+08:00 values, both legacy modes, millisecond/microsecond precision, whole/fractional seconds, day rollover, and pre-epoch values. - 12 additional pre-epoch cases passed with both Python and native planners, including canonical bucket-DV precedence over stale copies, repeated deletion, and historical reads.
Seven Vortex tests were skipped in each expanded run because they require Python >= 3.11. These are targeted local runs, not the full CI suite; the Rust Plan CI job is still running at review time. No remaining blocking issues found.
Purpose
Use the planning APIs from apache/paimon-rust#831 (merged) to support native incremental and distributed scans in PyPaimon. Timestamp windows combine APPEND deltas into one plan so primary-key versions across commits are merged together; the ending snapshot supplies metadata and deletion vectors even when it contributes no APPEND files.
index-file-in-data-file-dirfor deletion-vector writes, reads, and abort cleanup. Preserve explicit paths and legacy Python index locations, handle partition-directory differences, and retain multiple DV index files in one bucket.partition.legacy-name, including timestamp precision and JVM-dependent floating spellings. Explicit DV paths remain authoritative; Java locations take precedence over older Python locations.apache/paimon-rustmain. The regular Python version matrix runs Python planning and mocked adapter tests; it still installs the released binding for SQL tests. Restore the shard upper-bound validation message and initialize distribution fields in the global-index test fixture.The native planner remains optional and disabled by default. The README documents supported scans, binding requirements, and fallback behavior.
The fork-runtime fix in apache/paimon-rust#832, Java timestamp formatting fix in apache/paimon-rust#833, and LTZ alias parser fix in apache/paimon-rust#834 are merged. Rust Plan CI builds the latest upstream main and now additionally requires apache/paimon-rust#838: it preserves the first occurrence of each
(partition, bucket)group across interleaved partitions, aligning append shard/slice positions with Python.Tests
Latest CI-fix validation with Python 3.11 and a wheel built from the Rust #838 branch:
TableScan.planentry point: eight batches reuse four plans with either planner. The focused test passed in both lanes.git diff --checkpassed.Review-fix validation with Python 3.11:
git diff --checkpassed.Earlier validation on this branch also passed 183 Python reader/Data Evolution tests including Lance, 25 native contiguous-window dataset tests, and 28 CI selection tests. The full Python version matrix and Java integration suite were not run locally; CI must confirm the final commits.