[Feature] Support managed BLOBs in primary-key tables and normal-file compaction across data-evolution field groups
@SteNicholas is already working on this.
Since Aug 14, 2026.
Assessment
This issue has not been assessed yet.
Description
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!
- Dominant language
- C++
- Stars
- 65
- Forks
- 29
- Avg merge
- 2d 30m
- Merged PRs (30d)
- 77
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from apache/paimon-cpp
-
enhancement
apache/paimon-cpp#381 · 1 assignee ·
-
Difficulty 4/5 3-5 days Newbie friendliness 30/100
apache/paimon-cpp#375 · 1 assignee ·
-
enhancement
Difficulty 5/5 Over a week Newbie friendliness 30/100
apache/paimon-cpp#369 · 1 assignee ·
-
enhancement
Difficulty 5/5 Over a week Newbie friendliness 45/100
apache/paimon-cpp#361 · 1 assignee ·
-
bug
Difficulty 4/5 3-5 days Newbie friendliness 68/100
apache/paimon-cpp#347 · 1 assignee ·
All issues in apache/paimon-cpp
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
AXERA-TECH/ax-llm#77 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
games-on-whales/wolf#509 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
bug-unconfirmed
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
NVIDIA/cuda-samples#453 ·