From 439dad5dad75774f4edd0f32b1f72df90603f9b9 Mon Sep 17 00:00:00 2001 From: fenfeng9 Date: Sat, 24 Jan 2026 19:22:38 +0800 Subject: [PATCH 1/6] GH-48949: [C++][Parquet] Add Result ReadRowGroup(s) APIs - Add Result-returning ReadRowGroup/ReadRowGroups - Deprecate Status/out-parameter overloads - Update C++ callers --- .../parquet/arrow/arrow_reader_writer_test.cc | 8 +-- cpp/src/parquet/arrow/fuzz_internal.cc | 11 ++-- cpp/src/parquet/arrow/reader.cc | 64 ++++++++++++------- cpp/src/parquet/arrow/reader.h | 39 ++++++++--- .../parquet/arrow/reader_writer_benchmark.cc | 2 +- 5 files changed, 83 insertions(+), 41 deletions(-) diff --git a/cpp/src/parquet/arrow/arrow_reader_writer_test.cc b/cpp/src/parquet/arrow/arrow_reader_writer_test.cc index edb59d9de30..b387038d5ee 100644 --- a/cpp/src/parquet/arrow/arrow_reader_writer_test.cc +++ b/cpp/src/parquet/arrow/arrow_reader_writer_test.cc @@ -2453,10 +2453,10 @@ TEST(TestArrowReadWrite, ReadSingleRowGroup) { std::shared_ptr r1, r2, r3, r4; // Read everything - ASSERT_OK_NO_THROW(reader->ReadRowGroup(0, &r1)); + ASSERT_OK_AND_ASSIGN(r1, reader->ReadRowGroup(0)); ASSERT_OK_NO_THROW(reader->RowGroup(1)->ReadTable(&r2)); - ASSERT_OK_NO_THROW(reader->ReadRowGroups({0, 1}, &r3)); - ASSERT_OK_NO_THROW(reader->ReadRowGroups({1}, &r4)); + ASSERT_OK_AND_ASSIGN(r3, reader->ReadRowGroups({0, 1})); + ASSERT_OK_AND_ASSIGN(r4, reader->ReadRowGroups({1})); std::shared_ptr
concatenated; @@ -4085,7 +4085,7 @@ TEST_F(TestNestedSchemaRead, ReadTablePartial) { ASSERT_NO_FATAL_FAILURE(ValidateTableArrayTypes(*table)); // columns: {group1.leaf1, leaf3} - ASSERT_OK_NO_THROW(reader_->ReadRowGroup(0, {0, 2}, &table)); + ASSERT_OK_AND_ASSIGN(table, reader_->ReadRowGroup(0, {0, 2})); ASSERT_EQ(table->num_rows(), NUM_SIMPLE_TEST_ROWS); ASSERT_EQ(table->num_columns(), 2); ASSERT_EQ(table->schema()->field(0)->name(), "group1"); diff --git a/cpp/src/parquet/arrow/fuzz_internal.cc b/cpp/src/parquet/arrow/fuzz_internal.cc index 7c4539bf518..bdbd90f98ca 100644 --- a/cpp/src/parquet/arrow/fuzz_internal.cc +++ b/cpp/src/parquet/arrow/fuzz_internal.cc @@ -98,16 +98,15 @@ namespace { Status FuzzReadData(std::unique_ptr reader) { auto final_status = Status::OK(); for (int i = 0; i < reader->num_row_groups(); ++i) { - std::shared_ptr
table; - auto row_group_status = reader->ReadRowGroup(i, &table); - if (row_group_status.ok()) { + auto table_result = reader->ReadRowGroup(i); + if (table_result.ok()) { // When reading returns successfully, the Arrow data should be structurally // valid so that it can be read normally. If that is not the case, abort // so that the error can be published by OSS-Fuzz. - ARROW_CHECK_OK(table->Validate()); - row_group_status &= table->ValidateFull(); + ARROW_CHECK_OK((*table_result)->Validate()); + final_status &= (*table_result)->ValidateFull(); } - final_status &= row_group_status; + final_status &= table_result.status(); } return final_status; } diff --git a/cpp/src/parquet/arrow/reader.cc b/cpp/src/parquet/arrow/reader.cc index 434430a875e..a77323d29fa 100644 --- a/cpp/src/parquet/arrow/reader.cc +++ b/cpp/src/parquet/arrow/reader.cc @@ -204,10 +204,7 @@ class FileReaderImpl : public FileReader { Result> ReadTable( const std::vector& column_indices) override { - std::shared_ptr
table; - RETURN_NOT_OK(ReadRowGroups(Iota(reader_->metadata()->num_row_groups()), - column_indices, &table)); - return table; + return ReadRowGroups(Iota(reader_->metadata()->num_row_groups()), column_indices); } Status GetFieldReader(int i, @@ -312,9 +309,8 @@ class FileReaderImpl : public FileReader { return ReadTable(Iota(reader_->metadata()->num_columns())); } - Status ReadRowGroups(const std::vector& row_groups, - const std::vector& indices, - std::shared_ptr
* table) override; + Result> ReadRowGroups(const std::vector& row_groups, + const std::vector& indices) override; // Helper method used by ReadRowGroups - read the given row groups/columns, skipping // bounds checks and pre-buffering. Takes a shared_ptr to self to keep the reader @@ -323,18 +319,18 @@ class FileReaderImpl : public FileReader { std::shared_ptr self, const std::vector& row_groups, const std::vector& column_indices, ::arrow::internal::Executor* cpu_executor); - Status ReadRowGroups(const std::vector& row_groups, - std::shared_ptr
* table) override { - return ReadRowGroups(row_groups, Iota(reader_->metadata()->num_columns()), table); + Result> ReadRowGroups( + const std::vector& row_groups) override { + return ReadRowGroups(row_groups, Iota(reader_->metadata()->num_columns())); } - Status ReadRowGroup(int row_group_index, const std::vector& column_indices, - std::shared_ptr
* out) override { - return ReadRowGroups({row_group_index}, column_indices, out); + Result> ReadRowGroup( + int row_group_index, const std::vector& column_indices) override { + return ReadRowGroups({row_group_index}, column_indices); } - Status ReadRowGroup(int i, std::shared_ptr
* table) override { - return ReadRowGroup(i, Iota(reader_->metadata()->num_columns()), table); + Result> ReadRowGroup(int i) override { + return ReadRowGroup(i, Iota(reader_->metadata()->num_columns())); } Result> GetRecordBatchReader( @@ -437,11 +433,13 @@ class RowGroupReaderImpl : public RowGroupReader { Status ReadTable(const std::vector& column_indices, std::shared_ptr<::arrow::Table>* out) override { - return impl_->ReadRowGroup(row_group_index_, column_indices, out); + ARROW_ASSIGN_OR_RAISE(*out, impl_->ReadRowGroup(row_group_index_, column_indices)); + return Status::OK(); } Status ReadTable(std::shared_ptr<::arrow::Table>* out) override { - return impl_->ReadRowGroup(row_group_index_, out); + ARROW_ASSIGN_OR_RAISE(*out, impl_->ReadRowGroup(row_group_index_)); + return Status::OK(); } private: @@ -1254,9 +1252,8 @@ Status FileReaderImpl::GetColumn(int i, FileColumnIteratorFactory iterator_facto return Status::OK(); } -Status FileReaderImpl::ReadRowGroups(const std::vector& row_groups, - const std::vector& column_indices, - std::shared_ptr
* out) { +Result> FileReaderImpl::ReadRowGroups( + const std::vector& row_groups, const std::vector& column_indices) { RETURN_NOT_OK(BoundsCheck(row_groups, column_indices)); // PARQUET-1698/PARQUET-1820: pre-buffer row groups/column chunks if enabled @@ -1270,8 +1267,7 @@ Status FileReaderImpl::ReadRowGroups(const std::vector& row_groups, auto fut = DecodeRowGroups(/*self=*/nullptr, row_groups, column_indices, /*cpu_executor=*/nullptr); - ARROW_ASSIGN_OR_RAISE(*out, fut.MoveResult()); - return Status::OK(); + return fut.MoveResult(); } Future> FileReaderImpl::DecodeRowGroups( @@ -1353,6 +1349,30 @@ Status FileReader::ReadTable(const std::vector& column_indices, return Status::OK(); } +Status FileReader::ReadRowGroup(int i, const std::vector& column_indices, + std::shared_ptr
* out) { + ARROW_ASSIGN_OR_RAISE(*out, ReadRowGroup(i, column_indices)); + return Status::OK(); +} + +Status FileReader::ReadRowGroup(int i, std::shared_ptr
* out) { + ARROW_ASSIGN_OR_RAISE(*out, ReadRowGroup(i)); + return Status::OK(); +} + +Status FileReader::ReadRowGroups(const std::vector& row_groups, + const std::vector& column_indices, + std::shared_ptr
* out) { + ARROW_ASSIGN_OR_RAISE(*out, ReadRowGroups(row_groups, column_indices)); + return Status::OK(); +} + +Status FileReader::ReadRowGroups(const std::vector& row_groups, + std::shared_ptr
* out) { + ARROW_ASSIGN_OR_RAISE(*out, ReadRowGroups(row_groups)); + return Status::OK(); +} + Status FileReader::Make(::arrow::MemoryPool* pool, std::unique_ptr reader, const ArrowReaderProperties& properties, diff --git a/cpp/src/parquet/arrow/reader.h b/cpp/src/parquet/arrow/reader.h index d0665ea3106..642546335f1 100644 --- a/cpp/src/parquet/arrow/reader.h +++ b/cpp/src/parquet/arrow/reader.h @@ -266,17 +266,40 @@ class PARQUET_EXPORT FileReader { ::arrow::Status ReadTable(const std::vector& column_indices, std::shared_ptr<::arrow::Table>* out); - virtual ::arrow::Status ReadRowGroup(int i, const std::vector& column_indices, - std::shared_ptr<::arrow::Table>* out) = 0; + /// \brief Read the given row group columns into a Table + virtual ::arrow::Result> ReadRowGroup( + int i, const std::vector& column_indices) = 0; - virtual ::arrow::Status ReadRowGroup(int i, std::shared_ptr<::arrow::Table>* out) = 0; + /// \brief Read the given row group into a Table + virtual ::arrow::Result> ReadRowGroup(int i) = 0; - virtual ::arrow::Status ReadRowGroups(const std::vector& row_groups, - const std::vector& column_indices, - std::shared_ptr<::arrow::Table>* out) = 0; + /// \brief Read the given row groups columns into a Table + virtual ::arrow::Result> ReadRowGroups( + const std::vector& row_groups, const std::vector& column_indices) = 0; - virtual ::arrow::Status ReadRowGroups(const std::vector& row_groups, - std::shared_ptr<::arrow::Table>* out) = 0; + /// \brief Read the given row groups into a Table + virtual ::arrow::Result> ReadRowGroups( + const std::vector& row_groups) = 0; + + /// \deprecated Deprecated in 24.0.0. Use arrow::Result version instead. + ARROW_DEPRECATED("Deprecated in 24.0.0. Use arrow::Result version instead.") + ::arrow::Status ReadRowGroup(int i, const std::vector& column_indices, + std::shared_ptr<::arrow::Table>* out); + + /// \deprecated Deprecated in 24.0.0. Use arrow::Result version instead. + ARROW_DEPRECATED("Deprecated in 24.0.0. Use arrow::Result version instead.") + ::arrow::Status ReadRowGroup(int i, std::shared_ptr<::arrow::Table>* out); + + /// \deprecated Deprecated in 24.0.0. Use arrow::Result version instead. + ARROW_DEPRECATED("Deprecated in 24.0.0. Use arrow::Result version instead.") + ::arrow::Status ReadRowGroups(const std::vector& row_groups, + const std::vector& column_indices, + std::shared_ptr<::arrow::Table>* out); + + /// \deprecated Deprecated in 24.0.0. Use arrow::Result version instead. + ARROW_DEPRECATED("Deprecated in 24.0.0. Use arrow::Result version instead.") + ::arrow::Status ReadRowGroups(const std::vector& row_groups, + std::shared_ptr<::arrow::Table>* out); /// \brief Scan file contents with one thread, return number of rows virtual ::arrow::Status ScanContents(std::vector columns, diff --git a/cpp/src/parquet/arrow/reader_writer_benchmark.cc b/cpp/src/parquet/arrow/reader_writer_benchmark.cc index 7523a781d89..2f8cbd73c8a 100644 --- a/cpp/src/parquet/arrow/reader_writer_benchmark.cc +++ b/cpp/src/parquet/arrow/reader_writer_benchmark.cc @@ -778,7 +778,7 @@ static void BM_ReadMultipleRowGroups(::benchmark::State& state) { auto arrow_reader = std::move(*arrow_reader_result); std::shared_ptr
table; - EXIT_NOT_OK(arrow_reader->ReadRowGroups(rgs, &table)); + PARQUET_ASSIGN_OR_THROW(table, arrow_reader->ReadRowGroups(rgs)); } SetBytesProcessed(state); } From ae2bfd68b058d6d380188e0178cb60f1c5a98d55 Mon Sep 17 00:00:00 2001 From: fenfeng9 Date: Sat, 24 Jan 2026 21:51:19 +0800 Subject: [PATCH 2/6] GH-48949: [R][Python][GLib] Switch Parquet ReadRowGroup(s) bindings to Result API --- c_glib/parquet-glib/arrow-file-reader.cpp | 14 ++++----- python/pyarrow/_parquet.pyx | 12 ++++---- python/pyarrow/includes/libparquet.pxd | 16 +++++----- r/src/parquet.cpp | 36 ++++++++--------------- 4 files changed, 30 insertions(+), 48 deletions(-) diff --git a/c_glib/parquet-glib/arrow-file-reader.cpp b/c_glib/parquet-glib/arrow-file-reader.cpp index 7c7d20291a5..86bf284d123 100644 --- a/c_glib/parquet-glib/arrow-file-reader.cpp +++ b/c_glib/parquet-glib/arrow-file-reader.cpp @@ -246,8 +246,7 @@ gparquet_arrow_file_reader_read_row_group(GParquetArrowFileReader *reader, { const gchar *tag = "[parquet][arrow][file-reader][read-row-group]"; auto parquet_arrow_file_reader = gparquet_arrow_file_reader_get_raw(reader); - std::shared_ptr arrow_table; - arrow::Status status; + arrow::Result> arrow_table_result; if (column_indices) { const auto n_columns = parquet_arrow_file_reader->parquet_reader()->metadata()->num_columns(); @@ -268,14 +267,13 @@ gparquet_arrow_file_reader_read_row_group(GParquetArrowFileReader *reader, } parquet_column_indices.push_back(column_index); } - status = parquet_arrow_file_reader->ReadRowGroup(row_group_index, - parquet_column_indices, - &arrow_table); + arrow_table_result = + parquet_arrow_file_reader->ReadRowGroup(row_group_index, parquet_column_indices); } else { - status = parquet_arrow_file_reader->ReadRowGroup(row_group_index, &arrow_table); + arrow_table_result = parquet_arrow_file_reader->ReadRowGroup(row_group_index); } - if (garrow_error_check(error, status, tag)) { - return garrow_table_new_raw(&arrow_table); + if (garrow::check(error, arrow_table_result, tag)) { + return garrow_table_new_raw(&(*arrow_table_result)); } else { return NULL; } diff --git a/python/pyarrow/_parquet.pyx b/python/pyarrow/_parquet.pyx index c1c20026db0..ce1d9fbeb14 100644 --- a/python/pyarrow/_parquet.pyx +++ b/python/pyarrow/_parquet.pyx @@ -1811,7 +1811,7 @@ cdef class ParquetReader(_Weakrefable): table : pyarrow.Table """ cdef: - shared_ptr[CTable] ctable + CResult[shared_ptr[CTable]] table_result vector[int] c_row_groups vector[int] c_column_indices @@ -1825,15 +1825,13 @@ cdef class ParquetReader(_Weakrefable): c_column_indices.push_back(index) with nogil: - check_status(self.reader.get() - .ReadRowGroups(c_row_groups, c_column_indices, - &ctable)) + table_result = self.reader.get().ReadRowGroups(c_row_groups, + c_column_indices) else: # Read all columns with nogil: - check_status(self.reader.get() - .ReadRowGroups(c_row_groups, &ctable)) - return pyarrow_wrap_table(ctable) + table_result = self.reader.get().ReadRowGroups(c_row_groups) + return pyarrow_wrap_table(GetResultValue(table_result)) def read_all(self, column_indices=None, bint use_threads=True): """ diff --git a/python/pyarrow/includes/libparquet.pxd b/python/pyarrow/includes/libparquet.pxd index c19977396fb..f82ddd4197b 100644 --- a/python/pyarrow/includes/libparquet.pxd +++ b/python/pyarrow/includes/libparquet.pxd @@ -534,15 +534,13 @@ cdef extern from "parquet/arrow/reader.h" namespace "parquet::arrow" nogil: CStatus ReadSchemaField(int i, shared_ptr[CChunkedArray]* out) int num_row_groups() - CStatus ReadRowGroup(int i, shared_ptr[CTable]* out) - CStatus ReadRowGroup(int i, const vector[int]& column_indices, - shared_ptr[CTable]* out) - - CStatus ReadRowGroups(const vector[int]& row_groups, - shared_ptr[CTable]* out) - CStatus ReadRowGroups(const vector[int]& row_groups, - const vector[int]& column_indices, - shared_ptr[CTable]* out) + CResult[shared_ptr[CTable]] ReadRowGroup(int i) + CResult[shared_ptr[CTable]] ReadRowGroup(int i, + const vector[int]& column_indices) + + CResult[shared_ptr[CTable]] ReadRowGroups(const vector[int]& row_groups) + CResult[shared_ptr[CTable]] ReadRowGroups(const vector[int]& row_groups, + const vector[int]& column_indices) CResult[unique_ptr[CRecordBatchReader]] GetRecordBatchReader(const vector[int]& row_group_indices, const vector[int]& column_indices) diff --git a/r/src/parquet.cpp b/r/src/parquet.cpp index 3633c51d45d..efdc584d87b 100644 --- a/r/src/parquet.cpp +++ b/r/src/parquet.cpp @@ -147,48 +147,36 @@ std::shared_ptr parquet___arrow___FileReader__ReadTable2( // [[parquet::export]] std::shared_ptr parquet___arrow___FileReader__ReadRowGroup1( const std::shared_ptr& reader, int i) { - std::shared_ptr table; - auto result = - RunWithCapturedRIfPossibleVoid([&]() { return reader->ReadRowGroup(i, &table); }); - - StopIfNotOk(result); - return table; + auto result = RunWithCapturedRIfPossible>( + [&]() { return reader->ReadRowGroup(i); }); + return ValueOrStop(result); } // [[parquet::export]] std::shared_ptr parquet___arrow___FileReader__ReadRowGroup2( const std::shared_ptr& reader, int i, const std::vector& column_indices) { - std::shared_ptr table; - auto result = RunWithCapturedRIfPossibleVoid( - [&]() { return reader->ReadRowGroup(i, column_indices, &table); }); - - StopIfNotOk(result); - return table; + auto result = RunWithCapturedRIfPossible>( + [&]() { return reader->ReadRowGroup(i, column_indices); }); + return ValueOrStop(result); } // [[parquet::export]] std::shared_ptr parquet___arrow___FileReader__ReadRowGroups1( const std::shared_ptr& reader, const std::vector& row_groups) { - std::shared_ptr table; - auto result = RunWithCapturedRIfPossibleVoid( - [&]() { return reader->ReadRowGroups(row_groups, &table); }); - - StopIfNotOk(result); - return table; + auto result = RunWithCapturedRIfPossible>( + [&]() { return reader->ReadRowGroups(row_groups); }); + return ValueOrStop(result); } // [[parquet::export]] std::shared_ptr parquet___arrow___FileReader__ReadRowGroups2( const std::shared_ptr& reader, const std::vector& row_groups, const std::vector& column_indices) { - std::shared_ptr table; - auto result = RunWithCapturedRIfPossibleVoid( - [&]() { return reader->ReadRowGroups(row_groups, column_indices, &table); }); - - StopIfNotOk(result); - return table; + auto result = RunWithCapturedRIfPossible>( + [&]() { return reader->ReadRowGroups(row_groups, column_indices); }); + return ValueOrStop(result); } // [[parquet::export]] From 43edf069c756a44d91e3f02c6440ffc466cece8f Mon Sep 17 00:00:00 2001 From: fenfeng9 <36840213+fenfeng9@users.noreply.github.com> Date: Tue, 27 Jan 2026 13:37:52 +0800 Subject: [PATCH 3/6] Update cpp/src/parquet/arrow/reader_writer_benchmark.cc Co-authored-by: Gang Wu --- cpp/src/parquet/arrow/reader_writer_benchmark.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpp/src/parquet/arrow/reader_writer_benchmark.cc b/cpp/src/parquet/arrow/reader_writer_benchmark.cc index 2f8cbd73c8a..33ef93c34b0 100644 --- a/cpp/src/parquet/arrow/reader_writer_benchmark.cc +++ b/cpp/src/parquet/arrow/reader_writer_benchmark.cc @@ -778,7 +778,7 @@ static void BM_ReadMultipleRowGroups(::benchmark::State& state) { auto arrow_reader = std::move(*arrow_reader_result); std::shared_ptr
table; - PARQUET_ASSIGN_OR_THROW(table, arrow_reader->ReadRowGroups(rgs)); + PARQUET_ASSIGN_OR_THROW(auto table, arrow_reader->ReadRowGroups(rgs)); } SetBytesProcessed(state); } From 4efdbb9ddfc096868b1933585c17cc4df2d99c32 Mon Sep 17 00:00:00 2001 From: fenfeng9 Date: Tue, 27 Jan 2026 14:48:32 +0800 Subject: [PATCH 4/6] Update cpp/src/parquet/arrow/reader_writer_benchmark.cc --- cpp/src/parquet/arrow/reader_writer_benchmark.cc | 1 - 1 file changed, 1 deletion(-) diff --git a/cpp/src/parquet/arrow/reader_writer_benchmark.cc b/cpp/src/parquet/arrow/reader_writer_benchmark.cc index 33ef93c34b0..2f288fd2eb0 100644 --- a/cpp/src/parquet/arrow/reader_writer_benchmark.cc +++ b/cpp/src/parquet/arrow/reader_writer_benchmark.cc @@ -777,7 +777,6 @@ static void BM_ReadMultipleRowGroups(::benchmark::State& state) { EXIT_NOT_OK(arrow_reader_result.status()); auto arrow_reader = std::move(*arrow_reader_result); - std::shared_ptr
table; PARQUET_ASSIGN_OR_THROW(auto table, arrow_reader->ReadRowGroups(rgs)); } SetBytesProcessed(state); From 3025c60838ec45d67cbbdaf7624a1fddbc9a24e7 Mon Sep 17 00:00:00 2001 From: fenfeng9 Date: Tue, 27 Jan 2026 15:14:59 +0800 Subject: [PATCH 5/6] GH-48949: [C++][Parquet] Use auto in ReadRowGroup tests --- cpp/src/parquet/arrow/arrow_reader_writer_test.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cpp/src/parquet/arrow/arrow_reader_writer_test.cc b/cpp/src/parquet/arrow/arrow_reader_writer_test.cc index b387038d5ee..a93d2f3961d 100644 --- a/cpp/src/parquet/arrow/arrow_reader_writer_test.cc +++ b/cpp/src/parquet/arrow/arrow_reader_writer_test.cc @@ -2451,12 +2451,12 @@ TEST(TestArrowReadWrite, ReadSingleRowGroup) { ASSERT_EQ(2, reader->num_row_groups()); - std::shared_ptr
r1, r2, r3, r4; + std::shared_ptr
r2; // Read everything - ASSERT_OK_AND_ASSIGN(r1, reader->ReadRowGroup(0)); + ASSERT_OK_AND_ASSIGN(auto r1, reader->ReadRowGroup(0)); ASSERT_OK_NO_THROW(reader->RowGroup(1)->ReadTable(&r2)); - ASSERT_OK_AND_ASSIGN(r3, reader->ReadRowGroups({0, 1})); - ASSERT_OK_AND_ASSIGN(r4, reader->ReadRowGroups({1})); + ASSERT_OK_AND_ASSIGN(auto r3, reader->ReadRowGroups({0, 1})); + ASSERT_OK_AND_ASSIGN(auto r4, reader->ReadRowGroups({1})); std::shared_ptr
concatenated; From b250c0be8517da7db57afe00256cfdfbbab9cc28 Mon Sep 17 00:00:00 2001 From: fenfeng9 <36840213+fenfeng9@users.noreply.github.com> Date: Tue, 27 Jan 2026 18:51:47 +0800 Subject: [PATCH 6/6] Update cpp/src/parquet/arrow/fuzz_internal.cc Co-authored-by: Sutou Kouhei --- cpp/src/parquet/arrow/fuzz_internal.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cpp/src/parquet/arrow/fuzz_internal.cc b/cpp/src/parquet/arrow/fuzz_internal.cc index bdbd90f98ca..8618a85fcca 100644 --- a/cpp/src/parquet/arrow/fuzz_internal.cc +++ b/cpp/src/parquet/arrow/fuzz_internal.cc @@ -103,8 +103,9 @@ Status FuzzReadData(std::unique_ptr reader) { // When reading returns successfully, the Arrow data should be structurally // valid so that it can be read normally. If that is not the case, abort // so that the error can be published by OSS-Fuzz. - ARROW_CHECK_OK((*table_result)->Validate()); - final_status &= (*table_result)->ValidateFull(); + auto table = *table_result; + ARROW_CHECK_OK(table->Validate()); + final_status &= table->ValidateFull(); } final_status &= table_result.status(); }