huberylee commented on code in PR #39393:
URL: https://github.com/apache/arrow/pull/39393#discussion_r1446054408


##########
cpp/src/parquet/arrow/reader_internal.h:
##########
@@ -68,15 +72,34 @@ class FileColumnIterator {
         schema_(reader->metadata()->schema()),
         row_groups_(row_groups.begin(), row_groups.end()) {}
 
+  explicit FileColumnIterator(int column_index, ParquetFileReader* reader,
+                              std::vector<int> row_groups, RowRangesOpt 
row_ranges)
+      : column_index_(column_index),
+        reader_(reader),
+        schema_(reader->metadata()->schema()),
+        row_groups_(row_groups.begin(), row_groups.end()),
+        row_ranges_(std::move(row_ranges)) {}
+
   virtual ~FileColumnIterator() {}
 
   std::unique_ptr<::parquet::PageReader> NextChunk() {
     if (row_groups_.empty()) {
       return nullptr;
     }
 
-    auto row_group_reader = reader_->RowGroup(row_groups_.front());
+    const int row_group_ordinal = row_groups_.front();
+    auto row_group_reader = reader_->RowGroup(row_group_ordinal);
     row_groups_.pop_front();
+    if (row_ranges_.has_value()) {
+      auto row_ranges_map = row_ranges_.value();
+      auto it = row_ranges_map.find(row_group_ordinal);
+      if (it != row_ranges_map.end()) {
+        auto index_reader = 
reader_->GetPageIndexReader()->RowGroup(row_group_ordinal);

Review Comment:
   > Error handling is required here when index_reader is not available.
   
   Yes, it should go back to original logical when index_reader is not 
available.



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