Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions cpp/src/parquet/encoding.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2175,6 +2175,10 @@ class DeltaBitPackDecoder : public DecoderImpl, virtual public TypedDecoder<DTyp

int GetInternal(T* buffer, int max_values) {
max_values = std::min(max_values, this->num_values_);
if (max_values == 0) {
return 0;
}

DCHECK_LE(static_cast<uint32_t>(max_values), total_value_count_);
int i = 0;
while (i < max_values) {
Expand Down Expand Up @@ -2272,6 +2276,9 @@ class DeltaLengthByteArrayDecoder : public DecoderImpl,
// Decode up to `max_values` strings into an internal buffer
// and reference them into `buffer`.
max_values = std::min(max_values, num_valid_values_);
if (max_values == 0) {
return 0;
}

int32_t data_size = 0;
const int32_t* length_ptr =
Expand Down Expand Up @@ -2406,6 +2413,10 @@ class DeltaByteArrayDecoder : public DecoderImpl,
// Decode up to `max_values` strings into an internal buffer
// and reference them into `buffer`.
max_values = std::min(max_values, num_valid_values_);
if (max_values == 0) {
return max_values;
}

suffix_decoder_.Decode(buffer, max_values);

int64_t data_size = 0;
Expand Down