mapleFU commented on code in PR #38784:
URL: https://github.com/apache/arrow/pull/38784#discussion_r1400722423


##########
cpp/src/parquet/encoding.cc:
##########
@@ -1983,7 +1990,7 @@ class DictByteArrayDecoderImpl : public 
DictDecoderImpl<ByteArrayType>,
     int values_decoded = 0;
 
     ArrowBinaryHelper<ByteArrayType> helper(out, num_values);
-    RETURN_NOT_OK(helper.Prepare(len_));
+    RETURN_NOT_OK(helper.Prepare());

Review Comment:
   🤔I'm not sure what do you mean `between dict and non-dict decoding`.
   
   ```c++
     inline void DecodeDict(TypedDecoder<Type>* dictionary) {
       dictionary_length_ = static_cast<int32_t>(dictionary->values_left());
       PARQUET_THROW_NOT_OK(dictionary_->Resize(dictionary_length_ * sizeof(T),
                                                /*shrink_to_fit=*/false));
       dictionary->Decode(reinterpret_cast<T*>(dictionary_->mutable_data()),
                          dictionary_length_);
     }
   
   ```
   
   Do you mean decoding to Dict? Or just decoding a RLE_DICT encoding data? I 
think for decoing `RLE_DICT` or `DELTA_BYTE_ARRAY`, we cannot find the exactly 
length for the page, so I don't think it's proper to `Prepare` here...



##########
cpp/src/parquet/encoding.cc:
##########
@@ -1983,7 +1990,7 @@ class DictByteArrayDecoderImpl : public 
DictDecoderImpl<ByteArrayType>,
     int values_decoded = 0;
 
     ArrowBinaryHelper<ByteArrayType> helper(out, num_values);
-    RETURN_NOT_OK(helper.Prepare(len_));
+    RETURN_NOT_OK(helper.Prepare());

Review Comment:
   🤔I'm not sure what do you mean `between dict and non-dict decoding`.
   
   ```c++
     inline void DecodeDict(TypedDecoder<Type>* dictionary) {
       dictionary_length_ = static_cast<int32_t>(dictionary->values_left());
       PARQUET_THROW_NOT_OK(dictionary_->Resize(dictionary_length_ * sizeof(T),
                                                /*shrink_to_fit=*/false));
       dictionary->Decode(reinterpret_cast<T*>(dictionary_->mutable_data()),
                          dictionary_length_);
     }
   
   ```
   
   Do you mean decoding to Dict? Or just decoding a RLE_DICT encoding data? I 
think for decoing `RLE_DICT` or `DELTA_BYTE_ARRAY`, we cannot find the exactly 
length for the page, so I don't think it's proper to `Prepare` here...



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