gitedmond commented on code in PR #51401:
URL: https://github.com/apache/arrow/pull/51401#discussion_r4063046732


##########
cpp/src/parquet/arrow/reader.cc:
##########
@@ -292,15 +298,17 @@ class FileReaderImpl : public FileReader {
     END_PARQUET_CATCH_EXCEPTIONS
   }
 
-  Status ReadColumn(int i, const std::vector<int>& row_groups,
+  Status ReadColumn(int column_index, const std::vector<int>& row_groups,
                     std::shared_ptr<ChunkedArray>* out) {
     std::unique_ptr<ColumnReader> flat_column_reader;
-    RETURN_NOT_OK(GetColumn(i, SomeRowGroupsFactory(row_groups), 
&flat_column_reader));
-    return ReadColumn(i, row_groups, flat_column_reader.get(), out);
+    RETURN_NOT_OK(
+        GetColumn(column_index, SomeRowGroupsFactory(row_groups), 
&flat_column_reader));
+    ARROW_ASSIGN_OR_RAISE(auto field_indices, 
manifest_.GetFieldIndices({column_index}));

Review Comment:
   Updated in `44324b348`. `FileReader::ReadColumn` now treats the argument as 
the top-level `field_index` it already is and passes it unchanged to the 
tracing helper. I also renamed the parameter in the implementation and header, 
and updated the direct-read test to verify both the returned data and tracing 
attributes.



##########
cpp/src/parquet/arrow/reader.cc:
##########
@@ -1374,14 +1382,16 @@ Future<std::shared_ptr<Table>> 
FileReaderImpl::DecodeRowGroups(
   std::vector<std::shared_ptr<ColumnReaderImpl>> readers;
   std::shared_ptr<::arrow::Schema> result_schema;
   RETURN_NOT_OK(GetFieldReaders(column_indices, row_groups, &readers, 
&result_schema));
+  ARROW_ASSIGN_OR_RAISE(auto field_indices, 
manifest_.GetFieldIndices(column_indices));

Review Comment:
   Updated in `44324b348`. `GetFieldReaders` now returns the exact 
`field_indices` vector used to construct the readers and schema. 
`DecodeRowGroups` uses that returned vector instead of recomputing it, removing 
the ordering assumption and duplicate mapping work.



-- 
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