Repository navigation
[python] Use native scans for supplied primary-key index results - #10591
Conversation
leaves12138
left a comment
There was a problem hiding this comment.
Reviewed the native GlobalIndexResult handoff against the Java scan semantics and the dependent Rust API. The PK snapshot/physical-split path, DE row-ID score propagation, incremental handling, query-auth fallback, and Python metadata invalidation are consistent. Focused planner tests and static checks passed; no blocking issues found.
leaves12138
left a comment
There was a problem hiding this comment.
Blocking: the current commit fails the existing Python test suite on both Python 3.12 and 3.13. The failure is : receives instead of . The regression comes from , where the new guard treats the test's minimal as truthy and skips . Please make this check robust for the existing scanner contract or update the fixture/coverage so the full Python CI passes.
|
Correction to the review body above (the shell stripped inline backticks): Blocking: the current commit fails the existing Python test suite on both Python 3.12 and 3.13. The failure is The regression comes from |
leaves12138
left a comment
There was a problem hiding this comment.
Correction to the review body above (the shell stripped inline backticks):
Blocking: the current commit fails the existing Python test suite on both Python 3.12 and 3.13. The failure is pypaimon/tests/global_index_test.py::GlobalIndexScalarFallbackTest::test_split_planning_merges_indexed_and_unindexed_ranges: DataEvolutionSplitGenerator receives row_ranges=None instead of [Range(1, 1), Range(10, 10 ** 12)].
The regression comes from paimon-python/pypaimon/read/scanner/file_scanner.py:477, where the new and not self.table.options.query_auth_enabled guard treats the test's minimal Mock().options.query_auth_enabled as truthy and skips _eval_global_index. Please make this check robust for the existing scanner contract or update the fixture/coverage so the full Python CI passes.
leaves12138
left a comment
There was a problem hiding this comment.
Re-reviewed the updated HEAD. The query-auth test now explicitly covers both enabled and disabled options, and the focused regression test plus the complete global_index_test.py suite pass locally. The native GlobalIndexResult handoff remains consistent with Java semantics and the dependent Rust API. No blocking issues found.
Purpose
Use Rust core for PyPaimon's existing supplied primary-key index-result scans. PK vector/full-text results already carry a snapshot and physical file positions; these must be handed to the normal scan without resolving latest again or changing their source splits.
Depends on apache/paimon-rust#1133. This PR is draft until that Rust API is available on
main. Native CI continues building Rustmain.GlobalIndexResult.GlobalIndexResultreturned by searches directly in Native scans, avoiding explicit result conversion or a Python split-wire round trip. Exposing mutable splits or copying/serializing a result invalidates the original native handle, so subsequent scans observe Python metadata edits.Tests
Locally built the binding from the dependent Rust PR.
Regression cases cover Native/Python readers, historical and empty results, source metadata preservation, filter/limit/shard ordering, direct Core result handoff for vector/batch-vector/full-text/hybrid, ranked reads with final split-score checks, pickle and shallow-copy aliasing, edited Python selections, DE score ordering and incremental windows, and ignoring raw index results under REST authorization.