[Feature] Unpack predicate boolean kernel bitmaps a byte at a time
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 74/100
Direzione di ricerca
Inizia in src/paimon/common/utils/arrow/ e individua MultiLiteralsLeafFunction e NullFalseLeafBinaryFunction, quindi traccia i loro loop esistenti da bitmap a byte attraverso LeafFunction::Test. Aggiungi l’helper condiviso e un property test che copra ogni offset e lunghezza, entrambi i valori di negazione e i periodi di validità non allineati ai byte. Il lavoro è completo quando l’helper corrisponde al riferimento dell’accessor riga per riga ed entrambi i chiamanti restituiscono byte invariati.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Search before asking
- I searched in the issues and found nothing similar.
Motivation
Two predicate leaf functions evaluate a batch by running an arrow::compute kernel and reading back the arrow::BooleanArray it writes: MultiLiteralsLeafFunction (IN / NOT IN, via IsIn) and NullFalseLeafBinaryFunction (the comparison functions). A kernel returns a bitmap, one bit per row, but LeafFunction::Test returns std::vector<char>, one byte per row, so both call sites spread the bits over bytes with the same per-row loop: test IsNull, read Value, apply the negation NOT IN needs, store a byte. That is a shift, a mask and a byte store per row, duplicated across the two call sites, on the selection path every filtered batch goes through.
Solution
Extract the spread into one helper, ArrowUtils::UnpackBooleansToBytes(array, negate), and read the bitmap a byte at a time instead of a bit at a time:
- A compile-time table maps each of the 256 bitmap bytes to the eight bytes it expands to, so the aligned body produces eight rows per iteration with one lookup and one 8-byte store.
- A scalar head and tail cover the rows sharing a partial leading or trailing byte, which is where the array offset is not byte-aligned; a batch a kernel has just written is aligned, so it takes the fast body throughout.
- The offset and the validity bitmap are honoured exactly as
BooleanArray::Value()andArray::IsValid()honour them, and a null row unpacks to 0 whatever the value bitmap holds for it, which is what bothIN/NOT INand everyNullFalseLeafBinaryFunctionrequire.
MultiLiteralsLeafFunction passes its negate through; NullFalseLeafBinaryFunction passes negate=false. The bytes each returns are unchanged.
Anything else?
A property test that asserts the helper equals a row-by-row reference through the very accessors it replaces, over every (offset, length) slice of a bitmap whose value and null periods are not multiples of eight and both negate values, pins the offset, validity and negate handling against the definitions it optimizes. No change to any header under include/paimon/, the storage format, or the protocol: ArrowUtils is an internal utility under src/paimon/common/utils/arrow/.
Are you willing to submit a PR?
- I'm willing to submit a PR!
- Lingua principale
- C++
- Stelle
- 65
- Fork
- 29
- Merge medio
- 2g 30m
- PR unite (30g)
- 77
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di apache/paimon-cpp
-
enhancement
apache/paimon-cpp#381 · 1 assegnatario ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 30/100
apache/paimon-cpp#375 · 1 assegnatario ·
-
enhancement
Difficoltà 5/5 Più di una settimana Idoneità per principianti 30/100
apache/paimon-cpp#369 · 1 assegnatario ·
-
enhancement
Difficoltà 5/5 Più di una settimana Idoneità per principianti 45/100
apache/paimon-cpp#361 · 1 assegnatario ·
-
bug
Difficoltà 4/5 3-5 giorni Idoneità per principianti 68/100
apache/paimon-cpp#347 · 1 assegnatario ·
Tutte le issue di apache/paimon-cpp
Issue simili
-
enhancement
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
QuantStack/git2cpp#187 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
AXERA-TECH/ax-llm#77 ·
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
games-on-whales/wolf#509 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100