From 0b078955eeb18e8b039c51bb25850f63b947b3cd Mon Sep 17 00:00:00 2001 From: Panchen Xue Date: Thu, 18 Jan 2018 18:04:23 -0500 Subject: [PATCH] ARROW-1945: [C++] Add data_capacity_ to track capacity of value data --- cpp/src/arrow/builder.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cpp/src/arrow/builder.h b/cpp/src/arrow/builder.h index 59293bff4b8c2..a708122c2930b 100644 --- a/cpp/src/arrow/builder.h +++ b/cpp/src/arrow/builder.h @@ -688,7 +688,7 @@ class ARROW_EXPORT BinaryBuilder : public ArrayBuilder { /// \return size of values buffer so far int64_t value_data_length() const { return value_data_builder_.length(); } /// \return capacity of values buffer - int64_t value_data_capacity() const { return value_data_builder_.capacity(); } + int64_t value_data_capacity() const { return data_capacity_; } /// Temporary access to a value. /// @@ -699,6 +699,7 @@ class ARROW_EXPORT BinaryBuilder : public ArrayBuilder { TypedBufferBuilder offsets_builder_; TypedBufferBuilder value_data_builder_; + int64_t data_capacity_; static constexpr int64_t kMaximumCapacity = std::numeric_limits::max() - 1; Status AppendNextOffset();