[Feature] Support managed BLOBs in primary-key tables and normal-file compaction across data-evolution field groups
@SteNicholas ci sta già lavorando.
Dal 14/8/2026.
Valutazione
Questa issue non è ancora stata valutata.
Descrizione
Search before asking
- I searched in the issues and found nothing similar.
Motivation
This tracks the roadmap item "Extend Data Evolution to primary-key tables and support compaction across evolved field groups" in #186.
One clarification on the wording first: neither Java nor C++ allows a row-tracking/data-evolution table to define primary keys (SchemaValidation.validateRowTracking on both sides). What the roadmap item maps to in Java is two capabilities:
- Managed BLOBs in primary-key tables —
[core][flink][spark] Support managed BLOBs in primary-key tables(apache/paimon#8617), extended by[core] Allow first-row merge engine for primary-key managed BLOB tables(apache/paimon#9201). BLOB payloads are externalized to shared.managed.blobpack files before entering the MergeTree write buffer, data files store small descriptors plus a.blobrefreference sidecar, and compaction rewrites descriptors verbatim while rebuilding the exact per-data-file reference set. - Compaction across data-evolution field groups —
[core] Introducer compaction for data-evolution table(apache/paimon#6828), with the planning rules of[core] Optimize data evolution compaction planning(apache/paimon#9177). Files sharing the same row-id range form one evolved field group; compaction merges the field groups of a contiguous row-id run into a single normal file without changing any row id.
paimon-cpp has neither today:
- A primary-key table with a BLOB column cannot even be created:
SchemaValidation::ValidateRowTrackingrequiresdata-evolution.enabledfor BLOB columns, which in turn forbids primary keys — an unsatisfiable pair. - A data-evolution table is never compacted: auto compaction cannot run on
bucket = -1, andAppendCompactCoordinator::Runonly implements the plain append rewrite, which would reorder rows and break row ids.
Solution
Port the two Java capabilities:
1. Managed BLOB storage for primary-key tables (apache/paimon#8617 + #9201)
PrimaryKeyBlobExternalizer: externalize non-null blob values of insert rows into rolling.managed.blobpacks (sealed byblob.target-file-size, copied through ablob.copy-buffer-sizebuffer) before they enter the write buffer; retract rows drop the payload. Uncommitted packs are deleted on abort/close;PrepareCommitseals and hands them over.ManagedBlobReferenceFile: the.blobrefsidecar of each data file, byte-compatible with Java (magic/version/count/writeUTF/CRC32, sorted and deduplicated), plusManagedBlobReferenceCollectoron the key-value write path so a compacted file lists exactly the packs its surviving rows still reference.- Lifecycle: the sidecar travels in the data file's extra files and dies with it (writer abort, uncommitted-file cleanup, snapshot expiration); pack files are shared and never deleted by table maintenance (orphan-files clean skips
.managed.blob). - Read path:
ManagedBlobResolvingBatchReaderresolves descriptors to payload bytes with one ranged read per surviving value after merging;blob-as-descriptorreturns the serialized descriptors instead. - Schema validation: only
deduplicate/partial-update/first-rowmerge engines,changelog-producermust staynone, nodata-file.external-paths(rejected on the raw option, even an empty string), managed blob fields cannot be primary/bucket/sequence keys or order a sequence group, and sequence-group-protected managed blob fields reject aggregate functions that need the retracted payload. - Postpone-bucket writers externalize the same way, so
bucket = -2tables hold descriptors too.
2. Compaction across data-evolution field groups (apache/paimon#6828 → #9177 planning rules)
DataEvolutionCompactCoordinator: group files by exact row-id range into evolved field groups; bin weight issum(max(file_size, source.split.open-file-cost)); a bin becomes a task once its weight strictly exceedstarget-file-size; a heavier-than-target group is compacted alone; a row-id gap always cuts the bin; a bin needs at leastcompaction.min.file-numfiles.DataEvolutionNormalCompactTask: read the group throughDataEvolutionSplitRead(newest field group wins per column), rewrite into exactly one output file, keep the input's first row id and the merged[min, max]sequence-number range so_ROW_IDstays stable.- Entry point:
AppendCompactCoordinator::Runplans with the data-evolution coordinator whendata-evolution.enabledis set (scanning every live file instead of only small ones), and rejects the removed legacy modedata-evolution.compaction.rewrite-row-ids=truelike Java does.
Anything else?
Known scope cuts against current Java, disclosed in the user docs (primary_key_table.rst, compaction.rst):
- Only top-level scalar
BLOBcolumns are managed;ARRAY<BLOB>/MAP<K, BLOB>andblob-descriptor.source-table(source-table FileIO credentials) are not supported yet. - Compaction does not yet include: deletion-vector rewrite/materialization (tables with
deletion-vectors.enabledkeep being rejected, see #169 for the read side), the projected-manifest candidate planning with ~100k-file batches and multi-round commits of apache/paimon#9177, dedicated BLOB pack compaction, and vector-store file planning (tables holding vector-store files are rejected until aVECTORtype lands).
Follow-up regression tests that need the runtime to pin expectations: concurrent partial-update/append commits racing a planned compaction (Java DataEvolutionTableTest), and compaction across real schema ids after ALTER TABLE.
Are you willing to submit a PR?
- I'm willing to submit a PR!
- Lingua principale
- C++
- Stelle
- 65
- Fork
- 29
- Merge medio
- 2g 30m
- PR unite (30g)
- 77
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di apache/paimon-cpp
-
enhancement
apache/paimon-cpp#381 · 1 assegnatario ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 30/100
apache/paimon-cpp#375 · 1 assegnatario ·
-
enhancement
Difficoltà 5/5 Più di una settimana Idoneità per principianti 30/100
apache/paimon-cpp#369 · 1 assegnatario ·
-
enhancement
Difficoltà 5/5 Più di una settimana Idoneità per principianti 45/100
apache/paimon-cpp#361 · 1 assegnatario ·
-
bug
Difficoltà 4/5 3-5 giorni Idoneità per principianti 68/100
apache/paimon-cpp#347 · 1 assegnatario ·
Tutte le issue di apache/paimon-cpp
Issue simili
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
AXERA-TECH/ax-llm#77 ·
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
games-on-whales/wolf#509 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
-
bug-unconfirmed
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
NVIDIA/cuda-samples#453 ·