tachyonwill commented on a change in pull request #12365: URL: https://github.com/apache/arrow/pull/12365#discussion_r801236398
########## File path: cpp/src/parquet/encoding.cc ########## @@ -2181,12 +2181,14 @@ class DeltaBitPackDecoder : public DecoderImpl, virtual public TypedDecoder<DTyp } int GetInternal(T* buffer, int max_values) { - max_values = std::min(max_values, this->num_values_); + int total_value_count = static_cast<int>(std::min( + total_value_count_, static_cast<uint32_t>(std::numeric_limits<int>::max()))); + max_values = std::min(max_values, total_value_count); + DCHECK_GE(max_values, 0); Review comment: I will probably second a followup PR to this one to change some of those DCHECKs in the calling code to exceptions -- 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-unsubscr...@arrow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org