This is an automated email from the ASF dual-hosted git repository.

adamreeve pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow.git


The following commit(s) were added to refs/heads/main by this push:
     new 2df2dd834ed GH-55385: [C++][Parquet] Remove unused 
`last_value_in_previous_page_` from `DeltaByteArrayDecoderImpl` (#55386)
2df2dd834ed is described below

commit 2df2dd834ed0980b95d383f66be8e57882a1b68b
Author: Omkar Kabde <[email protected]>
AuthorDate: Wed Nov 4 14:35:44 2026 +0530

    GH-55385: [C++][Parquet] Remove unused `last_value_in_previous_page_` from 
`DeltaByteArrayDecoderImpl` (#55386)
    
    ### Rationale for this change
    `DeltaByteArrayDecoderImpl` keeps a `last_value_in_previous_page_` member 
that is written when a page is fully consumed, but it is never read. It was 
meant to work around PARQUET-246 (files written with a bug where the previous 
value is carried across pages), but that workaround was never implemented, so 
the member is dead state.
    
    Fixes #55385
    
    ### What changes are included in this PR?
    Removes `last_value_in_previous_page_`, its initializer, the assignment 
after a page is consumed, and the TODO in `SetData` that referred to it. 
`last_value_` is still cleared at the start of each page, so decoding is 
unchanged.
    
    ### Are these changes tested?
    Yes, by the existing delta byte array decoder tests. No new tests are 
needed since there is no behaviour change.
    
    ### Are there any user-facing changes?
    No.
    
    ### Was AI used for this PR?
    **PR code and description written by:**
    
    - [x] Human
    - [x] AI
    
    **Reviewed before submission by:**
    - [x] Human
    
    * GitHub Issue: #55385
    
    Authored-by: Omkar Kabde <[email protected]>
    Signed-off-by: Adam Reeve <[email protected]>
---
 cpp/src/parquet/decoder.cc | 9 ---------
 1 file changed, 9 deletions(-)

diff --git a/cpp/src/parquet/decoder.cc b/cpp/src/parquet/decoder.cc
index 8da344379c6..6832d93507c 100644
--- a/cpp/src/parquet/decoder.cc
+++ b/cpp/src/parquet/decoder.cc
@@ -2050,7 +2050,6 @@ class DeltaByteArrayDecoderImpl : public 
TypedDecoderImpl<DType> {
         pool_(pool),
         prefix_len_decoder_(nullptr, pool),
         suffix_decoder_(nullptr, pool),
-        last_value_in_previous_page_(""),
         buffered_prefix_length_(AllocateBuffer(pool, 0)),
         buffered_data_(AllocateBuffer(pool, 0)) {}
 
@@ -2081,8 +2080,6 @@ class DeltaByteArrayDecoderImpl : public 
TypedDecoderImpl<DType> {
     // at this time, the decoder_ will be at the start of the encoded suffix 
data.
     suffix_decoder_.SetData(num_values, data + suffix_begins, bytes_left);
 
-    // TODO: read corrupted files written with bug(PARQUET-246). last_value_ 
should be set
-    // to last_value_in_previous_page_ when decoding a new page(except the 
first page)
     last_value_.clear();
   }
 
@@ -2309,10 +2306,6 @@ class DeltaByteArrayDecoderImpl : public 
TypedDecoderImpl<DType> {
     num_valid_values_ -= max_values;
     last_value_ = std::string{prefix};
 
-    if (num_valid_values_ == 0) {
-      last_value_in_previous_page_ = last_value_;
-    }
-
     return max_values;
   }
 
@@ -2363,8 +2356,6 @@ class DeltaByteArrayDecoderImpl : public 
TypedDecoderImpl<DType> {
   DeltaBitPackDecoder<Int32Type> prefix_len_decoder_;
   DeltaLengthByteArrayDecoder suffix_decoder_;
   std::string last_value_;
-  // string buffer for last value in previous page
-  std::string last_value_in_previous_page_;
   int num_valid_values_{0};
   uint32_t prefix_len_offset_{0};
   std::shared_ptr<ResizableBuffer> buffered_prefix_length_;

Reply via email to