[Feature] Support writing MAP<K, BLOB> fields
Mantenedores costumam responder em até 1 dia
@SteNicholas já está trabalhando nisso.
Desde 2/10/2026.
Avaliação
Esta issue ainda não foi avaliada.
Descrição
Search before asking
- I searched in the issues and found nothing similar.
Motivation
Java Paimon (apache/paimon#8635, with key types extended in apache/paimon#8963 and apache/paimon#9057) and PyPaimon can write top-level MAP<K, BLOB> columns to dedicated .blob files. #283 (PR #278) adds read-only MAP<K, BLOB> support to Paimon C++, and #389 (PR #392) adds write support for ARRAY<BLOB>, but C++ table creation (TableSchema::Create) and writes (FileStoreWrite::Create) still reject MAP<K, BLOB> fields through BlobUtils::ValidateContainerBlobWriteSchema. As a result, C++ users cannot write keyed collections of multimodal objects, such as the images of one sample keyed by camera name, to a Paimon table.
Solution
Add Java-compatible write support for top-level MAP<K, BLOB> fields declared with blob-field:
- Schema validation: Keep the rules consistent with Java and with
ARRAY<BLOB>(#392):- allow
MAP<K, BLOB>only as a top-level field declared withblob-field; - reject it for
blob-descriptor-field,blob-view-field, partition keys, and tables without data evolution; - reject unsupported key types and
BLOBvalues nested more deeply, such asMAP<K, ARRAY<BLOB>>orARRAY<MAP<K, BLOB>>.
- allow
- Blob format writer: Extend
BlobFormatWriterto encode eachMAP<K, BLOB>row as the nested payload defined in the BLOB file spec and decoded by the C++ reader from #278. The payload contains:- map magic
1296188226; - version 1;
- entry count;
- concatenated key data;
- concatenated BLOB data;
- Delta-Varint key length index;
- Delta-Varint BLOB length index;
- key index length and BLOB index length.
- map magic
- Key encoding: Match the Java key encodings for the key types supported by the C++ reader:
TINYINT,SMALLINT,INT,BIGINT: fixed-width little-endian signed integers;BOOLEAN: one byte,0or1;DATE: four-byte little-endian days since epoch;DECIMAL(p, s): an eight-byte little-endian unscaled value forp <= 18, and the minimal-length big-endian two's-complement unscaled value forp > 18;STRING: UTF-8 bytes;BINARY: raw bytes.
- Null handling: Distinguish null maps (outer length
-1), empty maps (entry count0), null values (BLOB length-1), and empty values (BLOB length0). Reject null keys and duplicate keys, as Java does (apache/paimon#9107). - Value sources: Support both inline raw bytes and
BlobDescriptorvalues. Descriptor values are materialized from their referenced storage when written, as Java does and as theARRAY<BLOB>writer does. - Placeholder: Support data-evolution partial updates of
MAP<K, BLOB>by recognizing an internal placeholder row on the write channel, aligned with JavaBlobMapPlaceholder, and persisting it as a-2entry. The fallback reader from #278 then resolves these rows from older sequence layers. - Write path: Route
MAP<K, BLOB>fields to dedicated blob files in the data-evolution write path, and remove the write-side rejection inBlobUtils::ValidateContainerBlobWriteSchema. - Documentation: Update
data_types.rstandwrite.rst, which currently state that Paimon C++ can read but not writeMAP<kt, BLOB>columns. - Tests:
- add unit tests for payload encoding of every supported key type, null/empty cases, null/duplicate key rejection, and error handling;
- add round-trip tests with the C++ reader from #278, including placeholder fallback across sequence layers;
- add Java/Python cross-compatibility tests, with C++ writing and Java/Python reading.
Anything else?
- Depends on #283 / #278 for the reader side and builds on the
ARRAY<BLOB>writer from #389 / #392. TIMEkeys (apache/paimon#9009), compaction of data-evolution tables,paimon.map.selected-keysforMAP<K, BLOB>reads, andMAP<K, BLOB>in primary-key managed BLOB storage (#204) are out of scope and can be tracked separately.- No public API changes are expected. The storage format follows the existing Java spec.
Are you willing to submit a PR?
- I'm willing to submit a PR!
- Linguagem predominante
- C++
- Estrelas
- 65
- Forks
- 31
- Merge médio
- 1d 23h
- PRs com merge (30d)
- 64
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Tem um modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de apache/paimon-cpp
-
enhancement
Dificuldade 5/5 Mais de uma semana Facilidade para iniciantes 35/100
apache/paimon-cpp#410 ·
Mantenedores costumam responder em até 1 dia
-
enhancement
Dificuldade 5/5 Mais de uma semana Facilidade para iniciantes 25/100
apache/paimon-cpp#409 ·
Mantenedores costumam responder em até 1 dia
-
enhancement
Dificuldade 5/5 Mais de uma semana Facilidade para iniciantes 35/100
apache/paimon-cpp#408 ·
Mantenedores costumam responder em até 1 dia
-
enhancement
Dificuldade 5/5 Mais de uma semana Facilidade para iniciantes 35/100
apache/paimon-cpp#407 ·
Mantenedores costumam responder em até 1 dia
-
enhancement
Dificuldade 5/5 Mais de uma semana Facilidade para iniciantes 35/100
apache/paimon-cpp#406 ·
Mantenedores costumam responder em até 1 dia
Todas as issues de apache/paimon-cpp
Issues semelhantes
-
bug chart-audit
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 92/100
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 85/100
godotengine/godot#124120 ·
Mantenedores costumam responder em até 1 dia
-
HasBacktrace Priority-Critical
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
azerothcore/azerothcore-wotlk#27921 ·
Mantenedores costumam responder em até 1 dia
-
area/ysql kind/bug priority/medium
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 86/100
yugabyte/yugabyte-db#34584 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 88/100
Mantenedores costumam responder em até 1 dia