mapleFU commented on PR #38784:
URL: https://github.com/apache/arrow/pull/38784#issuecomment-1825781099

   ```diff
   diff --git a/cpp/src/parquet/encoding.cc b/cpp/src/parquet/encoding.cc
   index c529ea47a..ffcdd2c95 100644
   --- a/cpp/src/parquet/encoding.cc
   +++ b/cpp/src/parquet/encoding.cc
   @@ -1213,6 +1213,7 @@ struct ArrowBinaryHelper<ByteArrayType> {
        if (ARROW_PREDICT_FALSE(!CanFit(next_value_length))) {
          // This element would exceed the capacity of a chunk
          RETURN_NOT_OK(PushChunk());
   +      RETURN_NOT_OK(acc_->builder->Reserve(entries_remaining_));
        }
        return Status::OK();
      }
   @@ -1933,7 +1934,7 @@ class DictByteArrayDecoderImpl : public 
DictDecoderImpl<ByteArrayType>,
        // The `len_` in the ByteArrayDictDecoder is the total length of the
        // RLE/Bit-pack encoded data size, so, we cannot use `len_` to reserve
        // space for binary data.
   -    // RETURN_NOT_OK(helper.Prepare());
   +    RETURN_NOT_OK(helper.Prepare());
    
        auto dict_values = reinterpret_cast<const 
ByteArray*>(dictionary_->data());
        int values_decoded = 0;
   @@ -2004,7 +2005,7 @@ class DictByteArrayDecoderImpl : public 
DictDecoderImpl<ByteArrayType>,
        // The `len_` in the ByteArrayDictDecoder is the total length of the
        // RLE/Bit-pack encoded data size, so, we cannot use `len_` to reserve
        // space for binary data.
   -    // RETURN_NOT_OK(helper.Prepare());
   +    RETURN_NOT_OK(helper.Prepare());
    
        auto dict_values = reinterpret_cast<const 
ByteArray*>(dictionary_->data());
    
   diff --git a/cpp/submodules/parquet-testing b/cpp/submodules/parquet-testing
   index da467dac2..d69d97922 160000
   --- a/cpp/submodules/parquet-testing
   +++ b/cpp/submodules/parquet-testing
   @@ -1 +1 @@
   -Subproject commit da467dac2f095b979af37bcf40fa0d1dee5ff652
   +Subproject commit d69d979223e883faef9dc6fe3cf573087243c28a
   ```
   
   @jorisvandenbossche Would you mind try this locally? I only have MacOS with 
me I think macos might cannot produce the regression, so I want to make clear 
if it's the `Prepare` which reserve the `::arrow::Binary` that make the thing 
worse...


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