diff --git a/cpp/src/arrow/gpu/cuda_test.cc b/cpp/src/arrow/gpu/cuda_test.cc index b8c2bf0eaba9b..1014d34485c5c 100644 --- a/cpp/src/arrow/gpu/cuda_test.cc +++ b/cpp/src/arrow/gpu/cuda_test.cc @@ -708,7 +708,6 @@ TEST_F(TestCudaArrowIpc, WriteIpcList) { ASSERT_EQ(values_device->data()->buffers[0]->address(), payload.body_buffers[0]->address()); - } TEST_F(TestCudaArrowIpc, DictionaryWriteRead) { diff --git a/cpp/src/arrow/ipc/writer.cc b/cpp/src/arrow/ipc/writer.cc index cce93600716b5..da19edc5d1023 100644 --- a/cpp/src/arrow/ipc/writer.cc +++ b/cpp/src/arrow/ipc/writer.cc @@ -449,11 +449,11 @@ class RecordBatchSerializer { template enable_if_base_binary Visit(const T& array) { using offset_type = typename T::offset_type; - + std::shared_ptr value_offsets; RETURN_NOT_OK(GetZeroBasedValueOffsets(array, &value_offsets)); - auto data = array.value_data(); - + auto data = array.value_data(); + int64_t total_data_bytes = 0; if (value_offsets) { offset_type first_offset_value, last_offset_value; @@ -503,15 +503,15 @@ class RecordBatchSerializer { offset_type values_offset = 0; offset_type values_length = 0; - if (value_offsets) { + if (value_offsets) { RETURN_NOT_OK(MemoryManager::CopyBufferSliceToCPU( - value_offsets, 0, sizeof(offset_type), - reinterpret_cast(&values_offset))); + value_offsets, 0, sizeof(offset_type), + reinterpret_cast(&values_offset))); offset_type last_values_offset = 0; RETURN_NOT_OK(MemoryManager::CopyBufferSliceToCPU( - value_offsets, array.length() * sizeof(offset_type), sizeof(offset_type), - reinterpret_cast(&last_values_offset))); - + value_offsets, array.length() * sizeof(offset_type), sizeof(offset_type), + reinterpret_cast(&last_values_offset))); + values_length = last_values_offset - values_offset; }