[Feature] Support shared-shredding storage layout for MAP columns
Maintainer antworten meist innerhalb von 1 Tag
@lszskye arbeitet bereits daran.
Seit 21.9.2026.
Bewertung
- Schwierigkeit
- 5/5
- Geschätzter Aufwand
- Über eine Woche
- Anfängerfreundlichkeit
- 35/100
Rechercherichtung
Beginne mit PIP-43 und verfolge die bestehenden Schnittstellen FormatWriter, FileBatchReader, AppendOnlyWriter, LeafPredicate und PredicateConverter. Bilde die Schreib- und Lesepfade ab, bevor du die Komponenten für Schema-Konvertierung, Metadaten, Allokation, Prädikatsübersetzung und Rekonstruktion implementierst. Fertig bedeutet, dass shared-shredding-MAP-Spalten beim Schreiben, Lesen, Filtern, bei Overflow und bei unterschiedlichen K-Werten über Dateien hinweg funktionieren.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
Search before asking
- I searched in the issues and found nothing similar.
Motivation
In time-series / IoT / observability workloads, a common pattern is storing free-schema fields in a MAP<STRING, T> column (e.g. metrics MAP<STRING, DOUBLE>). The default MAP storage (two KV arrays) provides:
- No per-key columnar access
- No per-key statistics
- No predicate pushdown on individual keys
This makes queries like SELECT ext_map['usage'] FROM metrics WHERE ext_map['usage'] > 30 scan the entire MAP column — extremely inefficient when only 1–3 keys out of thousands are needed per query.
The PIP-43: Columnar Storage Optimization for MAP Type in Paimon proposes a new shared-shredding storage layout that stores MAP values in K reusable physical columns within a Struct, achieving near-full columnar access with per-key statistics and predicate pushdown — without changing the logical type (MAP<STRING, T>).
Solution
Physical Layout
Each MAP<STRING, T> column configured with fields.<column>.map.storage-layout = shared-shredding is physically stored as:
STRUCT<
__field_mapping: FixedSizeList<Int32, K>, -- per-row: which field_id each col holds
__col_0: T, __col_1: T, ..., __col_{K-1}: T, -- reusable typed columns
__overflow: MAP<INT32, T> -- rare fallback for rows with > K fields
>
fields.<column>.map.shared-shredding.max-columns controls K_max, and fields.<column>.map.shared-shredding.column-placement-policy controls column placement.
File metadata (footer) stores: field name↔id dictionary, field_id→physical column set S, overflow set O, K, and max row width.
Write Path
-
Schema conversion utilities — Logical MAP → physical Struct schema rewriting; metadata serialization/deserialization; shared-shredding column detection via field metadata marker.
-
FormatWriter::AddMetadata— New virtual method (default no-op) for writing key-value metadata to file footer beforeFinish(). Parquet implementation callsAddKeyValueMetadata. -
Column allocator — Per-row slot allocator that maps field IDs to up to
Kphysical columns and sends the rest to overflow. Placement policy is configurable (plain,sequential,lru; defaultplain). Accumulates file-level statistics (S, O, max row width). -
Logical→physical batch converter — Parses logical MAP, encodes field names to integer IDs (file-level dictionary), invokes allocator per row, assembles physical Struct array.
-
Writer integration — Extended DataFileWriter that performs conversion before writing + injects metadata on close. AppendOnlyWriter detects shared-shredding columns and routes accordingly. Cross-file K adaptation (P99 of recent max row widths, capped by K_max).
Read Path
-
File metadata parsing — Parse shared-shredding metadata from file footer (dictionary, S, O, K). New
GetFileKeyValueMetadata()method onFileBatchReaderwith Parquet implementation. -
Predicate translation — Translate logical predicates on MAP keys into conservative OR predicates over physical sub-columns. Requires extending
LeafPredicateto support nested field paths and updatingPredicateConverterto emit nestedFieldRef. -
Read planning — At
SetReadSchematime: look up which physical columns to read (from S), decide whether__overflowis needed (from O), translate predicates, and pass the physical schema + physical predicate down to the innerFileBatchReaderunchanged. -
Batch reconstruction — After
NextBatch: read__field_mappingper row to identify which column holds which field (fine-grained filter), gather values into logicalMAP<STRING, T>. Merge overflow when needed. Correctness relies on per-row__field_mapping, not on pushdown precision. -
Reader integration — A wrapper reader (implements
FileBatchReader) sits between the upper layer and the format-level reader. Per-file instance. Compatible with varying K across files. Orthogonal toDataEvolutionFileReader(schema evolution).
Anything else?
No response
Are you willing to submit a PR?
- I'm willing to submit a PR!
- Vorherrschende Sprache
- C++
- Sterne
- 65
- Forks
- 31
- Ø Merge
- 1 T. 14 Std.
- Gemergte PRs (30 T.)
- 60
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus apache/paimon-cpp
-
[Feature] Warm up next data file in ConcatBatchReaderEvtl. vergeben @SteNicholas hat das vor 3 Tagen übernommen. Offenenhancement
apache/paimon-cpp#419 · 1 zugewiesene Person ·
Maintainer antworten meist innerhalb von 1 Tag
-
[Feature] Derive Parquet data file stats from in-memory writer metadata instead of re-reading footerEvtl. vergeben @SteNicholas hat das vor 3 Tagen übernommen. Offenenhancement
apache/paimon-cpp#417 · 1 zugewiesene Person ·
Maintainer antworten meist innerhalb von 1 Tag
-
[Feature] Support writing MAP<K, BLOB> fieldsEvtl. vergeben @SteNicholas hat das vor 5 Tagen übernommen. Offenenhancement
apache/paimon-cpp#415 · 1 zugewiesene Person ·
Maintainer antworten meist innerhalb von 1 Tag
-
enhancement
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 35/100
apache/paimon-cpp#410 ·
Maintainer antworten meist innerhalb von 1 Tag
-
enhancement
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 25/100
apache/paimon-cpp#409 ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in apache/paimon-cpp
Ähnliche Issues
-
Component: Ruby Type: bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 74/100
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 88/100
Maintainer antworten meist innerhalb von 3 Tagen
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 92/100
kokkos/kokkos-kernels#3328 ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug needs triage tcp
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
project-chip/connectedhomeip#74644 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 82/100
Maintainer antworten meist innerhalb von 1 Tag