[Feature] Unpack predicate boolean kernel bitmaps a byte at a time
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 74/100
Línea de trabajo
Comienza en src/paimon/common/utils/arrow/ y localiza MultiLiteralsLeafFunction y NullFalseLeafBinaryFunction; después, sigue sus bucles existentes de bitmap a byte a través de LeafFunction::Test. Añade el helper compartido y una prueba de propiedades que cubra cada offset y longitud, ambos valores de negación y periodos de validez no alineados con bytes. Se considera terminado cuando el helper coincide con la referencia del accessor fila por fila y ambos llamadores devuelven bytes sin cambios.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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!
- Lenguaje dominante
- C++
- Estrellas
- 65
- Forks
- 29
- Merge medio
- 2 d 4 h
- PR fusionados (30 d)
- 78
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de apache/paimon-cpp
-
enhancement
apache/paimon-cpp#381 · 1 asignado ·
-
Dificultad 4/5 3-5 días Aptitud para principiantes 30/100
apache/paimon-cpp#375 · 1 asignado ·
-
enhancement
Dificultad 5/5 Más de una semana Aptitud para principiantes 45/100
apache/paimon-cpp#361 · 1 asignado ·
-
enhancement
Dificultad 4/5 3-5 días Aptitud para principiantes 45/100
apache/paimon-cpp#325 · 1 asignado ·
-
enhancement
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
apache/paimon-cpp#319 · 1 reacción · 1 asignado ·
Todos los issues de apache/paimon-cpp
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
objectionary/eo-graphs#74 ·
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 95/100
-
enhancement
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
QuantStack/git2cpp#187 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 86/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100