tachyonwill commented on a change in pull request #12365: URL: https://github.com/apache/arrow/pull/12365#discussion_r801183544
########## 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: On this subject, I noticed that DeltaByteArrayDecoder was only looking at the number of valid values in its prefix sub-decoder but not its suffix decoder; I added an exception if the suffix sub-decoder does not return the correct number of values. -- 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