AntoinePrv commented on code in PR #50629:
URL: https://github.com/apache/arrow/pull/50629#discussion_r4338966896


##########
cpp/src/parquet/column_reader.h:
##########
@@ -351,105 +383,57 @@ class PARQUET_EXPORT RecordReader {
   virtual const void* ReadDictionary(int32_t* dictionary_length) = 0;
 
   /// \brief Decoded definition levels
-  int16_t* def_levels() const {
-    return reinterpret_cast<int16_t*>(def_levels_->mutable_data());
-  }
+  ///
+  /// This always return a valid pointer, except:
+  /// - when the max definition level is zero (non-repeated required values).
+  /// - when `allow_levels_optimization` is true and the column is a flat 
optional type.
+  virtual int16_t* def_levels() const = 0;
 
   /// \brief Decoded repetition levels
-  int16_t* rep_levels() const {
-    return reinterpret_cast<int16_t*>(rep_levels_->mutable_data());
-  }
+  ///
+  /// This always return a valid pointer, except when the max repetition level 
is
+  /// zero (some repeated fields).

Review Comment:
   Yes, I guess it is "no repeated fields" 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