Skip to content
This repository has been archived by the owner on May 10, 2024. It is now read-only.

Commit

Permalink
Merge 0be10bc into d15d268
Browse files Browse the repository at this point in the history
  • Loading branch information
philhoch committed Jun 21, 2018
2 parents d15d268 + 0be10bc commit 6f14465
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/parquet/encoding-internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -398,9 +398,11 @@ inline void DictionaryDecoder<ByteArrayType>::SetDict(
for (int i = 0; i < num_dictionary_values; ++i) {
total_size += dictionary_[i].len;
}
PARQUET_THROW_NOT_OK(byte_array_data_->Resize(total_size, false));
int offset = 0;
if (total_size > 0) {
PARQUET_THROW_NOT_OK(byte_array_data_->Resize(total_size, false));
}

int offset = 0;
uint8_t* bytes_data = byte_array_data_->mutable_data();
for (int i = 0; i < num_dictionary_values; ++i) {
memcpy(bytes_data + offset, dictionary_[i].ptr, dictionary_[i].len);
Expand Down

0 comments on commit 6f14465

Please sign in to comment.