pitrou commented on a change in pull request #8632:
URL: https://github.com/apache/arrow/pull/8632#discussion_r528694242



##########
File path: cpp/src/parquet/encoding.cc
##########
@@ -127,6 +130,25 @@ class PlainEncoder : public EncoderImpl, virtual public 
TypedEncoder<DType> {
   }
 
  protected:
+  template <typename ArrayType>
+  void PutBinaryArray(const ArrayType& array) {
+    const int64_t total_bytes =
+        array.value_offset(array.length()) - array.value_offset(0);
+    PARQUET_THROW_NOT_OK(sink_.Reserve(total_bytes + array.length() * 
sizeof(uint32_t)));
+
+    constexpr size_t kMaxByteArraySize = std::numeric_limits<uint32_t>::max();

Review comment:
       I've changed the code to check for the signed maximum. It will be safer 
in any case.




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to