benibus commented on code in PR #36675:
URL: https://github.com/apache/arrow/pull/36675#discussion_r1265761232


##########
cpp/src/parquet/arrow/reader.h:
##########
@@ -141,26 +141,19 @@ class PARQUET_EXPORT FileReader {
 
   /// \brief Read column as a whole into a chunked array.
   ///
-  /// The indicated column index is relative to the schema
+  /// The index i refers the index of the top level schema field, which may

Review Comment:
   It does return the full top-level struct column, unless I'm misunderstanding 
something. Here's the ad hoc test I used (dropped into 
`arrow_reader_writer_test.cc`)
   ```C++
   auto schema = ::arrow::schema({
       ::arrow::field("a", ::arrow::struct_({::arrow::field("c", 
::arrow::boolean()),
                                             ::arrow::field("d", 
::arrow::utf8())})),
       ::arrow::field("b", ::arrow::int32()),
   });
   auto table =
       ::arrow::TableFromJSON(schema, {R"([{"a": {"c": true, "d": "foo"}, "b": 
100}])"});
   
   std::shared_ptr<Buffer> buffer;
   ASSERT_NO_FATAL_FAILURE(WriteTableToBuffer(table, /*row_group_size=*/2,
                                              
default_arrow_writer_properties(), &buffer));
   std::unique_ptr<FileReader> reader;
   ASSERT_OK_NO_THROW(OpenFile(std::make_shared<BufferReader>(buffer),
                               ::arrow::default_memory_pool(), &reader));
   
   const int num_columns = 2;
   ::arrow::ChunkedArrayVector columns(num_columns);
   for (int i = 0; i < num_columns; ++i) {
     ASSERT_OK_NO_THROW(reader->ReadColumn(i, &columns[i]));
     ::arrow::AssertChunkedEqual(*table->column(i), *columns[i]);
   }
   
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to