pitrou commented on code in PR #41346:
URL: https://github.com/apache/arrow/pull/41346#discussion_r1587709421


##########
cpp/src/parquet/column_reader.cc:
##########
@@ -1028,12 +1030,17 @@ class TypedColumnReaderImpl : public 
TypedColumnReader<DType>,
   // and number of values to read. This function is called before reading 
values.
   void ReadLevels(int64_t batch_size, int16_t* def_levels, int16_t* rep_levels,
                   int64_t* num_def_levels, int64_t* values_to_read) {

Review Comment:
   Is it useful to have a  `int64_t* num_def_levels` if it's always going to be 
equal to `batch_size`? Can we remove this argument?



##########
cpp/src/parquet/column_reader.cc:
##########
@@ -1117,11 +1124,10 @@ int64_t TypedColumnReaderImpl<DType>::ReadBatch(int64_t 
batch_size, int16_t* def
   int64_t num_def_levels = 0;
   int64_t values_to_read = 0;
   ReadLevels(batch_size, def_levels, rep_levels, &num_def_levels, 
&values_to_read);
-
   *values_read = this->ReadValues(values_to_read, values);
+  ARROW_DCHECK_GE(values_to_read, *values_read);

Review Comment:
   Can this occur on a corrupted file? If so, it should be an exception.



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