You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/03/01 15:05:36 UTC

[GitHub] [arrow] pitrou commented on a change in pull request #12490: PARQUET-2131: Number values decoded DCHECKs should be exceptions

pitrou commented on a change in pull request #12490:
URL: https://github.com/apache/arrow/pull/12490#discussion_r816854536



##########
File path: cpp/src/parquet/column_reader.cc
##########
@@ -1478,13 +1478,21 @@ class TypedRecordReader : public ColumnReaderImplBase<DType>,
     int64_t num_decoded = this->current_decoder_->DecodeSpaced(
         ValuesHead<T>(), static_cast<int>(values_with_nulls),
         static_cast<int>(null_count), valid_bits, valid_bits_offset);
-    DCHECK_EQ(num_decoded, values_with_nulls);
+    if (ARROW_PREDICT_FALSE(num_decoded != values_with_nulls)) {
+      ParquetException::EofException("Decoded values " + std::to_string(num_decoded) +
+                                     " does not match expected " +
+                                     std::to_string(values_with_nulls));
+    }

Review comment:
       Can you factor out the check and error message in a convenience function or method?




-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org