pitrou commented on code in PR #14341:
URL: https://github.com/apache/arrow/pull/14341#discussion_r1205508405
##########
cpp/src/parquet/encoding.cc:
##########
@@ -3200,6 +3461,39 @@ 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;
+ using Base::pool_;
+
+ int Decode(FixedLenByteArray* buffer, int max_values) override {
+ // GetInternal currently only support ByteArray.
+ std::vector<ByteArray> decode_byte_array(max_values);
+ const int decoded_values_size = GetInternal(decode_byte_array.data(),
max_values);
+ const uint32_t type_length = descr_->type_length();
+
+ for (int i = 0; i < decoded_values_size; i++) {
+ if (ARROW_PREDICT_FALSE(decode_byte_array[i].len != type_length)) {
+ throw ParquetException("Fixed length byte array length mismatch");
+ }
+ buffer[i].ptr = decode_byte_array.data()->ptr + i * type_length;
Review Comment:
This depends on the `GetInternal` implementation. Why not:
```suggestion
buffer[i].ptr = decode_byte_array[i].ptr;
```
--
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]