This is an automated email from the ASF dual-hosted git repository.
kou pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow.git
The following commit(s) were added to refs/heads/main by this push:
new 3573f54888 GH-46094: [C++][Docs] Add note to RleDecoder::Get's doc
comment (#46874)
3573f54888 is described below
commit 3573f548881af39dd09cfd96b12c3a2b742f4699
Author: Hadrian Reppas <[email protected]>
AuthorDate: Sun Jun 22 21:02:10 2025 -0500
GH-46094: [C++][Docs] Add note to RleDecoder::Get's doc comment (#46874)
### Rationale for this change
The behavior of `RleDecoder::Get` caused some confusion in
https://github.com/apache/arrow/issues/46094.
### What changes are included in this PR?
Improvement to `RleDecoder::Get`'s doc comment.
### Are these changes tested?
N/A
### Are there any user-facing changes?
No.
* GitHub Issue: #46094
Authored-by: Hadrian Reppas <[email protected]>
Signed-off-by: Sutou Kouhei <[email protected]>
---
cpp/src/arrow/util/rle_encoding_internal.h | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/cpp/src/arrow/util/rle_encoding_internal.h
b/cpp/src/arrow/util/rle_encoding_internal.h
index 6f133f15b0..fab8c50512 100644
--- a/cpp/src/arrow/util/rle_encoding_internal.h
+++ b/cpp/src/arrow/util/rle_encoding_internal.h
@@ -112,6 +112,12 @@ class RleDecoder {
}
/// Gets the next value. Returns false if there are no more.
+ ///
+ /// NB: Because the encoding only supports literal runs with lengths
+ /// that are multiples of 8, RleEncoder sometimes pads the end of its
+ /// input with zeros. Since the encoding does not differentiate between
+ /// input values and padding, Get() returns true even for these padding
+ /// values.
template <typename T>
bool Get(T* val);