rok commented on code in PR #14293:
URL: https://github.com/apache/arrow/pull/14293#discussion_r1089853908
##########
cpp/src/parquet/encoding.cc:
##########
@@ -2572,6 +2572,139 @@ class DeltaBitPackDecoder : public DecoderImpl, virtual
public TypedDecoder<DTyp
// ----------------------------------------------------------------------
// DELTA_LENGTH_BYTE_ARRAY
+// ----------------------------------------------------------------------
+// DeltaLengthByteArrayEncoder
+
+template <typename DType>
+class DeltaLengthByteArrayEncoder : public EncoderImpl,
+ virtual public TypedEncoder<ByteArrayType>
{
+ public:
+ explicit DeltaLengthByteArrayEncoder(const ColumnDescriptor* descr,
MemoryPool* pool)
+ : EncoderImpl(descr, Encoding::DELTA_LENGTH_BYTE_ARRAY,
+ pool = ::arrow::default_memory_pool()),
+ sink_(pool),
+ length_encoder_(nullptr, pool),
+ encoded_size_{0} {}
+
+ std::shared_ptr<Buffer> FlushValues() override;
+
+ int64_t EstimatedDataEncodedSize() override {
+ return encoded_size_ + length_encoder_.EstimatedDataEncodedSize();
+ }
+
+ using TypedEncoder<ByteArrayType>::Put;
+
+ void Put(const ::arrow::Array& values) override;
+
+ void Put(const T* buffer, int num_values) override;
+
+ void PutSpaced(const T* src, int num_values, const uint8_t* valid_bits,
+ int64_t valid_bits_offset) override;
+
+ void Put(const ByteArray& val) {
+ // Write the result to the output stream
+ const int64_t increment = static_cast<int64_t>(val.len + sizeof(uint32_t));
Review Comment:
Indeed. Thanks for catching it!
--
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]