[python] Support raw fallback for global indexes - #8310
Merged
JingsongLi merged 4 commits intoJun 21, 2026
Conversation
leaves12138
approved these changes
Jun 21, 2026
leaves12138
left a comment
Contributor
There was a problem hiding this comment.
I reviewed this mainly against the Java raw-fallback implementation currently on master.
The Python changes look aligned with Java on the important semantics:
global-index.search-modekeepsfastas the default, whilefull/detailcompute unindexed row ranges fromnextRowId/ data-file row ranges.- The normal data-evolution scan only ORs raw/unindexed rows when the scalar global index actually returns a result; unsupported index evaluation still falls back to the full table scan.
- Vector scan now builds indexed vector splits plus a raw split from vector-uncovered and scalar-filter-uncovered ranges, matching Java
VectorScanImpl. - Vector read uses empty indexed pre-filters when a scalar filter exists but no scalar index can evaluate it, so indexed vector search won't run unfiltered and pollute topK; raw search keeps the table filter applied when reading raw vectors.
Validation I ran locally:
python -m pytest paimon-python/pypaimon/tests/global_index_test.py paimon-python/pypaimon/tests/vector_search_filter_test.py -q(53 passed)python -m pytest paimon-python/pypaimon/tests/range_test.py paimon-python/pypaimon/tests/partition_predicate_test.py paimon-python/pypaimon/tests/vindex_vector_index_test.py -q(24 passed)python -m pytest paimon-python/pypaimon/tests/global_index_test.py paimon-python/pypaimon/tests/vector_search_filter_test.py paimon-python/pypaimon/tests/global_index_evaluator_test.py paimon-python/pypaimon/tests/btree_thread_safety_test.py paimon-python/pypaimon/tests/global_index_update_action_test.py paimon-python/pypaimon/tests/index_manifest_write_test.py -q(89 passed)python -m compileall -q paimon-python/pypaimon/common/options/core_options.py paimon-python/pypaimon/globalindex paimon-python/pypaimon/read paimon-python/pypaimon/table/source
I also tried the full paimon-python/pypaimon/tests suite, but this local environment is missing optional deps such as parameterized and pypaimon_rust, so collection stops before executing the full suite.
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.
Summary
This PR ports the Java raw fallback behavior for global indexes to Python. It adds
global-index.search-modesupport and lets scalar global index scans and vector search include unindexed row ranges when configured withfullordetailsearch modes.Changes
GlobalIndexCoverageandglobal-index.search-mode(fast,full,detail) withfastas the default.GlobalIndexScannerwith a separateunindexed_rowsAPI and merge unindexed rows into scalar scan planning only when index scan succeeds.Testing
python -m pytest paimon-python/pypaimon/tests/global_index_test.py paimon-python/pypaimon/tests/vector_search_filter_test.py -qpython -m pytest paimon-python/pypaimon/tests/range_test.py paimon-python/pypaimon/tests/partition_predicate_test.py paimon-python/pypaimon/tests/vindex_vector_index_test.py -qpython -m compileall -q paimon-python/pypaimon/common/options/core_options.py paimon-python/pypaimon/globalindex paimon-python/pypaimon/read paimon-python/pypaimon/table/sourcegit diff --cached --check