Repository navigation
[Python] Use the common native global index builder - #10487
Conversation
leaves12138
left a comment
There was a problem hiding this comment.
Reviewed 7e986c78 with the locally rebuilt apache/paimon-rust#1091 extension at 6c30863f. No blocking findings.
The adapter uses the common core builder rather than exposing sorted implementation details, preserves unpublished CommitMessages and Python commit ownership, and only falls back before Native construction is eligible. Build errors are not swallowed into a second build. Effective full-text options retain the original list/string stop-word and boolean encodings, including build-option overrides of table defaults. Keeping vector construction on the original Python path is correct while core requires dense non-null vectors.
Independent validation with Python 3.10, PyArrow 19.0.1 and the rebuilt extension:
- Paired REST/index-build tests: 153 passed, 19 subtests passed, 55 Native plans exercised.
- Related index/search tests: 119 passed, 19 subtests passed.
- Additional reviewer tests: 34 passed for empty/all-NULL/sparse text shards, abort/rebuild, effective option overrides and non-indexed-column updates.
- Previous Rust wheel compatibility: 3 real REST builds passed for BTree, bitmap and full-text, using Classic fallback when the common factory is absent.
- Binding regression: 417 passed using a Native-generated smoke warehouse, not Java Docker fixtures.
Prepared full-text and all five vindex formats, both committers, partition conjunction, external placement, indexed-column conflicts with retained files, and existing Python fast-search reads were exercised. Java alignment was source/DEIX-contract comparison rather than a Java engine or production-storage run.
The Rust dependency and draft sequencing are appropriate. CI currently installs Rust main, so complete Native CI still needs to be rerun after #1091 merges; green results against an older main would not validate adoption of the new factory.
Purpose
Use the common Rust
Table.new_global_index_build_builder()API instead of exposing sorted-index implementation details to PyPaimon.Depends on apache/paimon-rust#1091. Keep this draft until the Rust API is on main. CI continues to install Rust main, with no fork or branch pin.
CommitMessagecontract and Python commit API.Tests
Using the local Rust PR extension:
PYPAIMON_TEST_NATIVE_PLAN=1 .venv/bin/python -m pytest pypaimon/tests/native_generic_index_build_test.py pypaimon/tests/native_sorted_index_build_test.py pypaimon/tests/global_index_build_test.py -q153 passed, 19 subtests passed; 55 native plans exercised.
The new regressions also compare native and original full-text metadata and searches for list/string stop words supplied through build or table options, and preserve nullable vector construction through the existing Python writer.
Changed Python files pass Flake8 with
dev/cfg.ini, Python 3.6 grammar parsing andgit diff --check.