@@ -2801,8 +2801,7 @@ TEST(TestArrowReadWrite, ReadCoalescedColumnSubset) {
28012801 {0 , 4 , 8 , 10 }, {0 , 1 , 2 , 3 }, {5 , 17 , 18 , 19 }};
28022802
28032803 for (std::vector<int >& column_subset : column_subsets) {
2804- std::shared_ptr<Table> result;
2805- ASSERT_OK_AND_ASSIGN (result, reader->ReadTable (column_subset));
2804+ ASSERT_OK_AND_ASSIGN (auto result, reader->ReadTable (column_subset));
28062805
28072806 std::vector<std::shared_ptr<::arrow::ChunkedArray>> ex_columns;
28082807 std::vector<std::shared_ptr<::arrow::Field>> ex_fields;
@@ -2839,8 +2838,7 @@ TEST(TestArrowReadWrite, ListLargeRecords) {
28392838 ::arrow::default_memory_pool ()));
28402839
28412840 // Read everything
2842- std::shared_ptr<Table> result;
2843- ASSERT_OK_AND_ASSIGN (result, reader->ReadTable ());
2841+ ASSERT_OK_AND_ASSIGN (auto result, reader->ReadTable ());
28442842 ASSERT_NO_FATAL_FAILURE (::arrow::AssertTablesEqual (*table, *result));
28452843
28462844 // Read 1 record at a time
@@ -3579,8 +3577,7 @@ void DoNestedValidate(const std::shared_ptr<::arrow::DataType>& inner_type,
35793577 ASSERT_OK (reader_builder.Build (&reader));
35803578 ARROW_SCOPED_TRACE (" Parquet schema: " ,
35813579 reader->parquet_reader ()->metadata ()->schema ()->ToString ());
3582- std::shared_ptr<Table> result;
3583- ASSERT_OK_AND_ASSIGN (result, reader->ReadTable ());
3580+ ASSERT_OK_AND_ASSIGN (auto result, reader->ReadTable ());
35843581
35853582 if (inner_type->id () == ::arrow::Type::DATE64 ||
35863583 inner_type->id () == ::arrow::Type::TIMESTAMP ||
@@ -4036,8 +4033,7 @@ class TestNestedSchemaRead : public ::testing::TestWithParam<Repetition::type> {
40364033TEST_F (TestNestedSchemaRead, ReadIntoTableFull) {
40374034 ASSERT_NO_FATAL_FAILURE (CreateSimpleNestedParquet (Repetition::OPTIONAL));
40384035
4039- std::shared_ptr<Table> table;
4040- ASSERT_OK_AND_ASSIGN (table, reader_->ReadTable ());
4036+ ASSERT_OK_AND_ASSIGN (auto table, reader_->ReadTable ());
40414037 ASSERT_EQ (table->num_rows (), NUM_SIMPLE_TEST_ROWS);
40424038 ASSERT_EQ (table->num_columns (), 2 );
40434039 ASSERT_EQ (table->schema ()->field (0 )->type ()->num_fields (), 2 );
@@ -4135,8 +4131,7 @@ TEST_P(TestNestedSchemaRead, DeepNestedSchemaRead) {
41354131 int num_rows = SMALL_SIZE * (depth + 2 );
41364132 ASSERT_NO_FATAL_FAILURE (CreateMultiLevelNestedParquet (num_trees, depth, num_children,
41374133 num_rows, GetParam ()));
4138- std::shared_ptr<Table> table;
4139- ASSERT_OK_AND_ASSIGN (table, reader_->ReadTable ());
4134+ ASSERT_OK_AND_ASSIGN (auto table, reader_->ReadTable ());
41404135 ASSERT_EQ (table->num_columns (), num_trees);
41414136 ASSERT_EQ (table->num_rows (), num_rows);
41424137
@@ -4365,8 +4360,7 @@ TEST(TestArrowReaderAdHoc, LegacyTwoLevelList) {
43654360 // Verify Arrow schema and data
43664361 ASSERT_OK_AND_ASSIGN (auto reader,
43674362 FileReader::Make (default_memory_pool (), std::move (file_reader)));
4368- std::shared_ptr<Table> table;
4369- ASSERT_OK_AND_ASSIGN (table, reader->ReadTable ());
4363+ ASSERT_OK_AND_ASSIGN (auto table, reader->ReadTable ());
43704364 ASSERT_OK (table->ValidateFull ());
43714365 AssertTablesEqual (*expected_table, *table);
43724366 };
@@ -4429,8 +4423,7 @@ TEST_P(TestArrowReaderAdHocSparkAndHvr, ReadDecimals) {
44294423
44304424 ASSERT_OK_AND_ASSIGN (auto arrow_reader,
44314425 FileReader::Make (pool, ParquetFileReader::OpenFile (path, false )));
4432- std::shared_ptr<::arrow::Table> table;
4433- ASSERT_OK_AND_ASSIGN (table, arrow_reader->ReadTable ());
4426+ ASSERT_OK_AND_ASSIGN (auto table, arrow_reader->ReadTable ());
44344427
44354428 std::shared_ptr<::arrow::Schema> schema;
44364429 ASSERT_OK_NO_THROW (arrow_reader->GetSchema (&schema));
@@ -4495,8 +4488,7 @@ TEST(TestArrowReaderAdHoc, ReadFloat16Files) {
44954488
44964489 ASSERT_OK_AND_ASSIGN (
44974490 auto reader, FileReader::Make (pool, ParquetFileReader::OpenFile (path, false )));
4498- std::shared_ptr<::arrow::Table> table;
4499- ASSERT_OK_AND_ASSIGN (table, reader->ReadTable ());
4491+ ASSERT_OK_AND_ASSIGN (auto table, reader->ReadTable ());
45004492
45014493 std::shared_ptr<::arrow::Schema> schema;
45024494 ASSERT_OK_NO_THROW (reader->GetSchema (&schema));
@@ -4907,8 +4899,7 @@ class TestArrowReadDictionary : public ::testing::TestWithParam<double> {
49074899 void CheckReadWholeFile (const Table& expected) {
49084900 ASSERT_OK_AND_ASSIGN (auto reader, GetReader ());
49094901
4910- std::shared_ptr<Table> actual;
4911- ASSERT_OK_AND_ASSIGN (actual, reader->ReadTable ());
4902+ ASSERT_OK_AND_ASSIGN (auto actual, reader->ReadTable ());
49124903 ::arrow::AssertTablesEqual (expected, *actual, /* same_chunk_layout=*/ false );
49134904 }
49144905
@@ -5005,8 +4996,7 @@ TEST_P(TestArrowReadDictionary, IncrementalReads) {
50054996
50064997 // Read in one shot
50074998 ASSERT_OK_AND_ASSIGN (std::unique_ptr<FileReader> reader, GetReader ());
5008- std::shared_ptr<Table> expected;
5009- ASSERT_OK_AND_ASSIGN (expected, reader->ReadTable ());
4999+ ASSERT_OK_AND_ASSIGN (auto expected, reader->ReadTable ());
50105000
50115001 ASSERT_OK_AND_ASSIGN (reader, GetReader ());
50125002 std::unique_ptr<ColumnReader> col;
@@ -5340,8 +5330,7 @@ TEST_P(TestNestedSchemaFilteredReader, ReadWrite) {
53405330 FileReaderBuilder builder;
53415331 ASSERT_OK_NO_THROW (builder.Open (std::make_shared<BufferReader>(buffer)));
53425332 ASSERT_OK (builder.properties (default_arrow_reader_properties ())->Build (&reader));
5343- std::shared_ptr<::arrow::Table> read_table;
5344- ASSERT_OK_AND_ASSIGN (read_table, reader->ReadTable (GetParam ().indices_to_read ));
5333+ ASSERT_OK_AND_ASSIGN (auto read_table, reader->ReadTable (GetParam ().indices_to_read ));
53455334
53465335 std::shared_ptr<::arrow::Array> expected =
53475336 ArrayFromJSON (GetParam ().expected_schema , GetParam ().read_data );
@@ -5817,10 +5806,9 @@ TEST(TestArrowReadWrite, MultithreadedWrite) {
58175806 ASSERT_OK_AND_ASSIGN (auto buffer, sink->Finish ());
58185807
58195808 // Read to verify the data.
5820- std::shared_ptr<Table> result;
58215809 ASSERT_OK_AND_ASSIGN (auto reader,
58225810 OpenFile (std::make_shared<BufferReader>(buffer), pool));
5823- ASSERT_OK_AND_ASSIGN (result, reader->ReadTable ());
5811+ ASSERT_OK_AND_ASSIGN (auto result, reader->ReadTable ());
58245812 ASSERT_NO_FATAL_FAILURE (::arrow::AssertTablesEqual (*table, *result));
58255813}
58265814
0 commit comments