Skip to content

[core][python] Unify global index configuration for PK and DE tables - #10914

Merged
JingsongLi merged 14 commits into
apache:masterfrom
JingsongLi:codex/unify-global-index-options
Nov 1, 2026
Merged

JingsongLi merged 14 commits into
apache:masterfrom
JingsongLi:codex/unify-global-index-options

Conversation

@JingsongLi

@JingsongLi JingsongLi commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

Purpose

Primary-key indexes use separate pk-* properties, preventing PK and Data Evolution tables from sharing global-index configuration. Unify declaration parsing and generic merging in CoreOptions, with vector-specific resolution in VectorIndexOptions in Java and Python. Keep each table mode's existing index lifecycle and remove index-specific schema validation.

Support global-index.<type>.index-columns, the singular index-column alias, type-level parameters such as ivf-pq.dimension, and short keys in fields.<column>.index-options. Retain legacy PK declarations, per-field vector types and JSON options, legacy metrics, and DLF flat field parameters. Apply the shared resolver to writes, compaction, builds, planning, indexed/raw reads, refinement, and Spark/Flink execution.

VectorIndexOptions.resolve returns the selected type and merged options together. Remove the independent indexType/index_type methods, old public PK index option definitions and primary-key-prefixed accessors. Handle legacy vector column/type pairing privately as a fallback. Remove interpretation of the historical external type hints index_type, index-type, vector.index-type, and fields.<column>.index-type; legitimate API arguments and persisted metadata retain their meaning.

Primary-key vector reads discover payloads by field and choose the implementation from valid persisted entries before consulting configuration. With no valid entries, use configuration for raw fallback. Share the immutable, serializable resolved result across local, batch, Flink and Spark readers. Keep explicit query metrics separate from table defaults so unspecified query metrics can come from index metadata.

Native execution delegates configuration parsing to Rust. Forward all effective schema options, including canonical and legacy declarations, original field JSON and opaque parameters. Remove the Python native index compatibility adapter, declaration removal, hint filtering, synthetic PK conversion, field JSON flattening, build whitelists and injected vector defaults. Remove the separate with_vector_index_type API. Single/batch searches and hybrid routes pass their explicit options separately from table defaults; full-text routes retain column-specific analyzers in the schema. A common encoder only converts values to strings/JSON and handles unset table options.

Native builds forward the raw merged table/user options and preserve an already captured snapshot view when applying build overrides. Ordinary and streaming scans no longer reject independent per-field index options because of older SDK configuration limitations. SDK configuration and execution errors propagate without retrying through Python. Rust owns type/options resolution, metadata precedence and PK versus DE index maintenance; its implementation is maintained separately. The contract is in paimon-python/dev/native-index-options.md.

Use representative native-context fixtures for unconfigured, legacy PK and DLF declarations. Stabilize MySQL CDC test timezone fixtures across DST transitions while preserving the existing three-hour timestamp conversion contract.

Validation

  • Java vector configuration regression suite: 222 Core tests, 2 Flink tests, 12 Spark vector-search tests and 1 configuration-document completeness check passed (237 total), with -Pspark3,flink1 and without fast-build.
  • Python regression suite: 574 tests and 171 subtests passed; 118 tests skipped because optional runtimes/services were unavailable. Focused final build/execution-boundary checks passed all 52 tests and 40 subtests, including new captured-view and unset-option cases, plus lossless low-level single/batch native reader transport.
  • Native transport tests cover old PK, DLF singular/plural declarations, shared/legacy field JSON, independent field options, query/route scope, standard builders without a type setter, captured/serialized execution, opaque parameters and propagated errors.
  • MySQL CDC: all 8 timezone regression cases passed, including spring/fall transitions, the repeated fall-back hour, resource/source agreement and the existing timestamp conversion. CDC module checks and compilation passed with -Pflink1 and without fast-build.
  • Full Python flake8, Maven formatting/checkstyle checks and git diff --check passed. Independent reviews covered resolver entry points, compatibility, metadata precedence, serialized execution and native transport.

The native runtime and Docker daemon were unavailable locally. Real native integration requires the corresponding Rust shared resolver; the full MySQL CDC container suite requires CI.

JingsongLi added a commit to JingsongLi/paimon-rust that referenced this pull request Oct 31, 2026
Share CoreOptions declaration and field-JSON resolution between PK and
append/Data Evolution indexes, following apache/paimon#10914. Retain legacy
PK and Rust aliases alongside DLF singular declarations and flat parameters.

Apply effective field options to native construction, compaction, indexed and
raw reads, query widths and refinement. Preserve table-mode routing and PK's
compaction-only index lifecycle. Share read caches by budget across fields.

Cover precedence, insertion order, invalid defaults, schema guards, native
build/read consistency, shard overrides and recovery with regression tests.

@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.

LGTM

@JingsongLi
JingsongLi merged commit b434233 into apache:master Nov 1, 2026
31 of 32 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