wgtmac commented on code in PR #34526:
URL: https://github.com/apache/arrow/pull/34526#discussion_r1142829225
##########
cpp/src/parquet/encoding.cc:
##########
@@ -466,6 +466,15 @@ struct DictEncoderTraits<FLBAType> {
// Initially 1024 elements
static constexpr int32_t kInitialHashTableSize = 1 << 10;
+int RlePreserveBufferSize(int num_values, int bit_width) {
+ // Note: because of the way RleEncoder::CheckBufferFull() is called, we have
to
+ // reserve
Review Comment:
The format of comment looks strange.
##########
cpp/src/parquet/encoding.cc:
##########
@@ -2883,7 +2989,26 @@ class RleBooleanDecoder : public DecoderImpl, virtual
public BooleanDecoder {
int DecodeArrow(int num_values, int null_count, const uint8_t* valid_bits,
int64_t valid_bits_offset,
typename EncodingTraits<BooleanType>::Accumulator* out)
override {
- ParquetException::NYI("DecodeArrow for RleBooleanDecoder");
+ if (null_count != 0) {
+ ParquetException::NYI("RleBoolean DecodeArrow with null slots");
Review Comment:
Is this a TODO or misuse for `null_count != 0`?
##########
cpp/src/parquet/encoding.cc:
##########
@@ -2855,7 +2963,7 @@ class RleBooleanDecoder : public DecoderImpl, virtual
public BooleanDecoder {
" (corrupt data page?)");
}
// Load the first 4 bytes in little-endian, which indicates the length
- num_bytes = ::arrow::bit_util::ToLittleEndian(SafeLoadAs<uint32_t>(data));
Review Comment:
Good catch
##########
cpp/src/parquet/encoding.cc:
##########
@@ -466,6 +466,15 @@ struct DictEncoderTraits<FLBAType> {
// Initially 1024 elements
static constexpr int32_t kInitialHashTableSize = 1 << 10;
+int RlePreserveBufferSize(int num_values, int bit_width) {
+ // Note: because of the way RleEncoder::CheckBufferFull() is called, we have
to
+ // reserve
+ // an extra "RleEncoder::MinBufferSize" bytes. These extra bytes won't be
used
+ // but not reserving them would cause the encoder to fail.
+ return 1 + ::arrow::util::RleEncoder::MaxBufferSize(bit_width, num_values) +
Review Comment:
What does 1 mean here?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]