[Feature] Resolve primary-key full-text index options and validate schemas
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 35/100
Hướng nghiên cứu
Start with src/paimon/core/index/pk/primary_key_index_definitions.cpp:208-211 and src/paimon/core/schema/schema_validation.cpp:565-570, then read docs/source/user_guide/primary_key_global_index.rst. Use the listed Java validation and option-resolution tests as behavioral references. Done means full-text options are preserved, all listed validation and cross-family checks run independently, documentation is corrected, and corresponding tests cover the specified cases.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Search before asking
- I searched in the issues and found nothing similar.
Motivation
Sub-issue of #399 (step 5: primary-key full-text index, options and validation).
Paimon C++ recognizes pk-full-text.index.columns, but two parts are missing:
- Options are dropped.
PrimaryKeyIndexDefinitions::Createbuilds theFULL_TEXTdefinition with an empty options map (src/paimon/core/index/pk/primary_key_index_definitions.cpp:208-211). Tokenizer options such asfull-text.tokenizer=jiebanever reach the index. - Validation is skipped.
SchemaValidation::ValidatePrimaryKeyBTreeIndexesreturns early whenpk-btree.index.columnsis empty (src/paimon/core/schema/schema_validation.cpp:565-570). A table that sets onlypk-full-text.index.columnstherefore gets none of the checks: column existence, column type, cross-family ownership, deletion vectors, bucket mode.docs/source/user_guide/primary_key_global_index.rstsays vector and full-text definitions "are recognized for validation", which is only true when BTree columns are also set.
Java behavior (apache/paimon#8651, apache/paimon#8672, apache/paimon#8922):
Option merging (CoreOptions#primaryKeyFullTextIndexOptions(column)):
- Start from the table options whose key starts with
full-text.. - Parse
fields.<column>.pk-full-text.index.optionsas a JSON object of string values. Reject:- anything that is not a JSON object:
<key> must be a JSON object of option key-value pairs. - an empty key:
<key> contains an empty option key. - a null value:
<key> value for key <k> must not be null.
- anything that is not a JSON object:
- Qualify keys that lack the
full-text.prefix. - Reject a key already set at table level with a different value:
<key> defines conflicting values for full-text.<k>.An equal value is accepted.
For example, {"full-text.tokenizer":"jieba","ngram.min-gram":"2"} resolves to full-text.tokenizer=jieba and full-text.ngram.min-gram=2. The full-text indexer later strips the prefix (see #400).
Schema validation (SchemaValidation#validatePrimaryKeyFullTextIndex, run when the key is present):
- Exactly one column:
pk-full-text.index.columns must contain exactly one column in the first release, but is [...]. - The column is not blank.
- The table is a primary-key table.
deletion-vectors.enabled = true, unless the merge engine isfirst-row.deletion-vectors.merge-on-read = falsewhen deletion vectors are enabled.- Fixed or postpone bucket mode:
bucket > 0orbucket = -2. - No
pk-clustering-override. - The column exists.
- The column type is
CHAR/VARCHAR/STRING. - The resolved options are valid, as in the merging rules above.
Cross-family checks apply to every primary-key index family:
- no duplicate column within one family key;
- a column can own at most one primary-key index across all families.
The maintainer factory also allows only one FULL_TEXT definition: Only one primary-key full-text index is supported.
Solution
- Resolve the full-text options for each
FULL_TEXTdefinition fromfields.<column>.pk-full-text.index.optionsand the table-levelfull-text.*options, using the rules above. - Validate primary-key index columns independently of whether BTree columns are set. Add the full-text rules and the cross-family checks.
- Fix the statement in
primary_key_global_index.rst. - Add tests aligned with Java
PrimaryKeyFullTextIndexValidationTestandPrimaryKeyIndexDefinitionsTest#testResolvesFullTextIndexOptions:- more than one column, a duplicate column, a blank column, an unknown column, an
INTcolumn - deletion vectors off, and
first-rowwith deletion vectors off - merge-on-read on
bucket = -1rejected,bucket = -2acceptedpk-clustering-override- the column already used by
pk-btree - malformed JSON
- a conflicting
tokenizer - an append table
- more than one column, a duplicate column, a blank column, an unknown column, an
Anything else?
- Java also rejects renaming, dropping, or changing the type of a primary-key index column during schema evolution (
SchemaManagerUtils#assertNotUpdatingPrimaryKeyIndexColumn). Paimon C++ has no schema-evolution API yet, so this can be added together with one. - This issue unblocks #409 and #410.
Are you willing to submit a PR?
- I'm willing to submit a PR!
- Ngôn ngữ chính
- C++
- Star
- 65
- Fork
- 31
- Merge trung bình
- 1 ngày 14 giờ
- Pull request đã merge (30 ngày)
- 60
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của apache/paimon-cpp
-
[Feature] Warm up next data file in ConcatBatchReaderCó thể đã có người làm @SteNicholas đã nhận 3 ngày trước. Đang mởenhancement
apache/paimon-cpp#419 · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Feature] Derive Parquet data file stats from in-memory writer metadata instead of re-reading footerCó thể đã có người làm @SteNicholas đã nhận 3 ngày trước. Đang mởenhancement
apache/paimon-cpp#417 · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Feature] Support writing MAP<K, BLOB> fieldsCó thể đã có người làm @SteNicholas đã nhận 5 ngày trước. Đang mởenhancement
apache/paimon-cpp#415 · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
apache/paimon-cpp#410 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
apache/paimon-cpp#409 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của apache/paimon-cpp
Issue tương tự
-
8-membered-ring atrop stereo lost in 2026.09.1Có thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mởbug
Độ khó 2/5 Nửa ngày Mức phù hợp với người mới 86/100
Maintainer thường phản hồi trong vòng 2 ngày
-
thread safetyĐang mở1.0
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
libasr headers?Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Type: Bug :bug:
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 83/100
-
LLVM trunk nightly build failureĐang mởllvm-trunk
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
Maintainer thường phản hồi trong vòng 1 ngày