rok commented on code in PR #14341:
URL: https://github.com/apache/arrow/pull/14341#discussion_r1162196583


##########
cpp/src/parquet/encoding.cc:
##########
@@ -3196,6 +3469,43 @@ class DeltaByteArrayDecoder : public DecoderImpl,
   std::shared_ptr<ResizableBuffer> buffered_data_;
 };
 
+class DeltaByteArrayDecoder : public DeltaByteArrayDecoderImpl<ByteArrayType> {
+ public:
+  using Base = DeltaByteArrayDecoderImpl<ByteArrayType>;
+  using Base::DeltaByteArrayDecoderImpl;
+
+  int Decode(ByteArray* buffer, int max_values) override {
+    return GetInternal(buffer, max_values);
+  }
+};
+
+class DeltaByteArrayFLBADecoder : public DeltaByteArrayDecoderImpl<FLBAType>,
+                                  virtual public FLBADecoder {
+ public:
+  using Base = DeltaByteArrayDecoderImpl<FLBAType>;
+  using Base::DeltaByteArrayDecoderImpl;
+
+  int Decode(ByteArray* buffer, int max_values) {
+    return GetInternal(buffer, max_values);
+  }
+  int Decode(FixedLenByteArray* buffer, int max_values) override {
+    int decoded_values_size = max_values;
+    if (MultiplyWithOverflow(decoded_values_size,
+                             descr_->type_length() * sizeof(ByteArray),
+                             &decoded_values_size)) {
+      throw ParquetException("excess expansion in DELTA_LENGTH_BYTE_ARRAY");
+    }
+    std::vector<uint8_t> decode_values(decoded_values_size);

Review Comment:
   Switched to:
   ```cpp
       ArrowPoolVector<uint8_t> decode_values(decoded_values_size,
                                              
::arrow::stl::allocator<uint8_t>(pool_));
   ```



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

Reply via email to