Skip to content

Commit 64c178a

Browse files
authored
feat(shredding): Add infrastructure for shared-shredding MAP storage layout (#348)
1 parent 200a487 commit 64c178a

14 files changed

Lines changed: 1280 additions & 1 deletion

include/paimon/defs.h

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -365,6 +365,21 @@ struct PAIMON_EXPORT Options {
365365
/// "partition.legacy-name" - The legacy partition name is using `ToString` for all types. If
366366
/// false, using casting to string for all types. Default value is "true".
367367
static const char PARTITION_GENERATE_LEGACY_NAME[];
368+
/// "map.storage-layout" - Suffix for per-column MAP storage layout configuration.
369+
/// Used as `fields.<column>.map.storage-layout`. Values: "default" (standard KV arrays)
370+
/// or "shared-shredding" (columnar shredding with column reuse). Default is "default".
371+
/// If set "shared-shredding", the column must be of type MAP<STRING, T>. Each column must be
372+
/// configured individually. For example, to enable shared-shredding layout for two columns
373+
/// "metrics" and "tags":
374+
/// fields.metrics.map.storage-layout = shared-shredding
375+
/// fields.tags.map.storage-layout = shared-shredding
376+
static const char MAP_STORAGE_LAYOUT[];
377+
/// "map.shared-shredding.max-columns" - Suffix for per-column upper bound K_max configuration.
378+
/// Used as `fields.<column>.map.shared-shredding.max-columns`. Only effective when
379+
/// map.storage-layout = shared-shredding. Rows with more fields than K_max spill to
380+
/// __overflow. Default value is 256. Each column can have its own max-columns setting.
381+
static const char MAP_SHARED_SHREDDING_MAX_COLUMNS[];
382+
368383
/// "blob-as-descriptor" - Read blob field using blob descriptor rather than blob
369384
/// bytes. Default value is "false".
370385
static const char BLOB_AS_DESCRIPTOR[];

src/paimon/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ set(PAIMON_COMMON_SRCS
137137
common/utils/bloom_filter64.cpp
138138
common/utils/crc32c.cpp
139139
common/utils/decimal_utils.cpp
140+
common/data/shredding/map_shared_shredding_utils.cpp
140141
common/utils/delta_varint_compressor.cpp
141142
common/utils/fields_comparator.cpp
142143
common/utils/path_util.cpp
@@ -531,6 +532,7 @@ if(PAIMON_BUILD_TESTS)
531532
common/utils/decimal_utils_test.cpp
532533
common/utils/threadsafe_queue_test.cpp
533534
common/utils/generic_lru_cache_test.cpp
535+
common/data/shredding/map_shared_shredding_utils_test.cpp
534536
STATIC_LINK_LIBS
535537
paimon_shared
536538
test_utils_static

0 commit comments

Comments
 (0)