[Feature] Unpack predicate boolean kernel bitmaps a byte at a time
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 74/100
Hướng nghiên cứu
Bắt đầu trong src/paimon/common/utils/arrow/ và tìm MultiLiteralsLeafFunction cùng NullFalseLeafBinaryFunction, sau đó lần theo các vòng lặp bitmap-to-byte hiện có của chúng qua LeafFunction::Test. Thêm helper dùng chung và một property test bao quát mọi offset và length, cả hai giá trị negate, cũng như các khoảng validity không căn theo ranh giới byte. Hoàn tất khi helper khớp với accessor reference theo từng hàng và cả hai caller trả về các byte không thay đổi.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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!
- Ngôn ngữ chính
- C++
- Star
- 65
- Fork
- 29
- Merge trung bình
- 2 ngày 4 giờ
- Pull request đã merge (30 ngày)
- 78
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của apache/paimon-cpp
-
enhancement
apache/paimon-cpp#381 · 1 người được giao ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 30/100
apache/paimon-cpp#375 · 1 người được giao ·
-
enhancement
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 45/100
apache/paimon-cpp#361 · 1 người được giao ·
-
enhancement
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
apache/paimon-cpp#325 · 1 người được giao ·
-
enhancement
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
apache/paimon-cpp#319 · 1 reaction · 1 người được giao ·
Tất cả issue của apache/paimon-cpp
Issue tương tự
-
AuTest Bug Tests
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
apache/trafficserver#13714 ·
-
bug build
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
facebookincubator/velox#19143 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
tenstorrent/tt-metal#57393 · 1 bình luận ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
objectionary/eo-graphs#74 ·