Skip to content

Commit

Permalink
Update BinaryBuilder::Resize(int64_t capacity) in builder.cc
Browse files Browse the repository at this point in the history
When building BinaryArrays with a known size using Resize and Reserve methods, space is also reserved for value_data_builder_ to prevent internal reallocation
  • Loading branch information
xuepanchen authored Jan 15, 2018
1 parent c2f8dc4 commit 232024e
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions cpp/src/arrow/builder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1223,6 +1223,7 @@ Status BinaryBuilder::Resize(int64_t capacity) {
DCHECK_LT(capacity, std::numeric_limits<int32_t>::max());
// one more then requested for offsets
RETURN_NOT_OK(offsets_builder_.Resize((capacity + 1) * sizeof(int64_t)));
RETURN_NOT_OK(value_data_builder_.Resize(capacity));
return ArrayBuilder::Resize(capacity);
}

Expand Down

0 comments on commit 232024e

Please sign in to comment.