We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a0aa749 commit 5704577Copy full SHA for 5704577
cpp/src/parquet/decoder.cc
@@ -790,8 +790,13 @@ class PlainByteArrayDecoder : public PlainDecoder<ByteArrayType> {
790
return Status::OK();
791
};
792
793
- return DispatchArrowBinaryHelper<ByteArrayType>(out, num_values, len_,
794
- visit_binary_helper);
+ // We're going to decode up to `num_values - null_count` PLAIN values,
+ // and each value has a 4-byte length header that doesn't count for the
795
+ // Arrow binary data length.
796
+ int64_t estimated_data_length =
797
+ std::max<int64_t>(0, len_ - 4 * (num_values - null_count));
798
+ return DispatchArrowBinaryHelper<ByteArrayType>(
799
+ out, num_values, estimated_data_length, visit_binary_helper);
800
}
801
802
template <typename BuilderType>
0 commit comments