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

   ```
   diff --git a/cpp/src/parquet/column_reader.cc 
b/cpp/src/parquet/column_reader.cc
   index a49e58afb..aa11dc57e 100644
   --- a/cpp/src/parquet/column_reader.cc
   +++ b/cpp/src/parquet/column_reader.cc
   @@ -1059,10 +1059,11 @@ class TypedColumnReaderImpl : public 
TypedColumnReader<DType>,
    
        // If the field is required and non-repeated, there are no definition 
levels
        if (this->max_def_level_ > 0 && def_levels != nullptr) {
   -      *num_def_levels = this->ReadDefinitionLevels(batch_size, def_levels);
   +      int64_t num_def_levels_value = this->ReadDefinitionLevels(batch_size, 
def_levels);
          // TODO(wesm): this tallying of values-to-decode can be performed 
with better
          // cache-efficiency if fused with the level decoding.
   -      for (int64_t i = 0; i < *num_def_levels; ++i) {
   +      *num_def_levels = num_def_levels_value;
   +      for (int64_t i = 0; i < num_def_levels_value; ++i) {
            if (def_levels[i] == this->max_def_level_) {
              ++(*values_to_read);
            }
   @@ -1909,7 +1910,8 @@ class TypedRecordReader : public 
TypedColumnReaderImpl<DType>,
    
        // When reading dense we need to figure out number of values to read.
        const int16_t* def_levels = this->def_levels();
   -    for (int64_t i = start_levels_position; i < levels_position_; ++i) {
   +    int64_t levels_position = levels_position_;
   +    for (int64_t i = start_levels_position; i < levels_position; ++i) {
          if (def_levels[i] == this->max_def_level_) {
            ++(*values_to_read);
          }
   ```
   
   I think code like this might minimal, and I don't know if this could be ok 
in this case...
   
   Also I don't know whether regression is related, will wait some days


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