diff --git a/cpp/src/parquet/encoding_benchmark.cc b/cpp/src/parquet/encoding_benchmark.cc index e74a9f55b124f..167879b120e05 100644 --- a/cpp/src/parquet/encoding_benchmark.cc +++ b/cpp/src/parquet/encoding_benchmark.cc @@ -1233,12 +1233,11 @@ class BenchmarkDecodeArrowByteArray : public BenchmarkDecodeArrowBasenull_bitmap_data(); total_size_ = input_array_->data()->buffers[2]->size(); - values_.reserve(num_values_); + values_.resize(num_values_); const auto& binary_array = static_cast(*input_array_); for (int64_t i = 0; i < binary_array.length(); i++) { auto view = binary_array.GetView(i); - values_.emplace_back(static_cast(view.length()), - reinterpret_cast(view.data())); + values_[i] = view; } }