Repository navigation
[core][python] Unify global index configuration for PK and DE tables - #10914
Merged
JingsongLi merged 14 commits intoNov 1, 2026
Merged
Conversation
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.
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.
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 inCoreOptions, with vector-specific resolution inVectorIndexOptionsin Java and Python. Keep each table mode's existing index lifecycle and remove index-specific schema validation.Support
global-index.<type>.index-columns, the singularindex-columnalias, type-level parameters such asivf-pq.dimension, and short keys infields.<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.resolvereturns the selected type and merged options together. Remove the independentindexType/index_typemethods, 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 hintsindex_type,index-type,vector.index-type, andfields.<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_typeAPI. 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
-Pspark3,flink1and withoutfast-build.-Pflink1and withoutfast-build.git diff --checkpassed. 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.