@@ -21,11 +21,30 @@ namespace paimon {
2121// / Specifies how shared-shredding MAP fields choose physical columns.
2222enum class MapSharedShreddingColumnPlacementPolicy {
2323 // / Keep the key order from each input MAP row and place the first K keys into columns 0..K-1.
24+ // / Use this when the input order is meaningful and should directly decide column placement.
25+ // / Example:
26+ // / K=2
27+ // / row [c, a, b] -> ordered [c, a, b] -> columns [c, a], overflow [b]
28+ // / row [a, b, c] -> ordered [a, b, c] -> columns [a, b], overflow [c]
2429 PLAIN = 0 ,
25- // / Use a stable key order before placing the first K keys into columns 0..K-1.
30+ // / Use the shared-shredding metadata order before placing the first K keys into columns 0..K-1.
31+ // / Use this when each row should choose leading-column keys by a deterministic metadata
32+ // / order instead of the input MAP entry order, and no cross-row history should be used.
33+ // / Example:
34+ // / K=2, metadata order [b, c, a]
35+ // / row [c, a, b] -> ordered [b, c, a] -> columns [b, c], overflow [a]
36+ // / row [c, a] -> ordered [c, a] -> columns [c, a], overflow []
37+ // / This does not reserve key-to-column mappings across rows.
2638 SEQUENTIAL = 1 ,
2739 // / Reuse columns for recently seen keys when possible; otherwise choose an empty column first,
2840 // / then the least-recently-used physical column.
41+ // / Use this when hot keys are likely to appear repeatedly across nearby rows and should stay
42+ // / in physical columns when possible.
43+ // / Example:
44+ // / K=3, existing columns [0:a, 1:b, 2:d]
45+ // / row [d, c, a, b] -> ordered [a, b, c, d]
46+ // / columns [a, b, d], overflow [c]
47+ // / If a key has already been evicted, it is treated like a new key when it appears again.
2948 LRU = 2
3049};
3150
0 commit comments