diff --git a/cpp/src/parquet/encoding_benchmark.cc b/cpp/src/parquet/encoding_benchmark.cc index e74a9f55b124f..34d12a624f6fc 100644 --- a/cpp/src/parquet/encoding_benchmark.cc +++ b/cpp/src/parquet/encoding_benchmark.cc @@ -1233,12 +1233,10 @@ 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] = binary_array.GetView(i); } } @@ -1431,10 +1429,10 @@ class BenchmarkDecodeArrowBoolean : public BenchmarkDecodeArrowBase // so, we uses this as "total_size" for the benchmark. total_size_ = ::arrow::bit_util::BytesForBits(num_values_); - values_.reserve(num_values_); + values_.resize(num_values_); const auto& boolean_array = static_cast(*input_array_); for (int64_t i = 0; i < boolean_array.length(); i++) { - values_.push_back(boolean_array.Value(i)); + values_[i] = boolean_array.Value(i); } }