Skip to content

[Python] Use the common native global index builder - #10487

Merged
JingsongLi merged 1 commit into
apache:masterfrom
JingsongLi:codex/native-global-index-builder
Oct 10, 2026
Merged

JingsongLi merged 1 commit into
apache:masterfrom
JingsongLi:codex/native-global-index-builder

Conversation

@JingsongLi

Copy link
Copy Markdown
Contributor

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.

  • Migrate local native construction and existing sorted-index tests to the common builder.
  • Delegate eligible REST full-text builds to core, preserving the unpublished CommitMessage contract and Python commit API.
  • Normalize effective full-text options through the existing full-text converter, preserving list-valued stop words and boolean/string encodings.
  • Keep vector construction on the Python path: the existing Rust vector pipeline still requires dense, non-null vectors, while Java/Python preserve sparse relative row IDs when vectors are null.
  • Add REST tests that directly exercise the common Rust builder for full-text and all five vindex types, partition conjunction, per-build shard sizing, external placement, both committers, source conflicts with retained files, and reading Rust-created files via Python fast search.

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 -q

153 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 and git diff --check.

@leaves12138 leaves12138 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@JingsongLi
JingsongLi marked this pull request as ready for review October 10, 2026 08:12
@JingsongLi
JingsongLi merged commit 5d902e8 into apache:master Oct 10, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants