pitrou commented on a change in pull request #11763:
URL: https://github.com/apache/arrow/pull/11763#discussion_r783301029



##########
File path: cpp/src/arrow/dataset/file_orc.cc
##########
@@ -85,24 +85,20 @@ class OrcScanTask : public ScanTask {
           included_fields.push_back(name);
         }
 
+        std::shared_ptr<RecordBatchReader> recordBatchReader;
+        reader->NextBatchReader(scan_options.batch_size, included_fields, 
&recordBatchReader);
+
         return RecordBatchIterator(
-            Impl{std::move(reader), 0, num_stripes, included_fields});
+            Impl{std::move(recordBatchReader)});
       }
 
       Result<std::shared_ptr<RecordBatch>> Next() {
-        if (i_ == num_stripes_) {
-          return nullptr;
-        }
         std::shared_ptr<RecordBatch> batch;
-        // TODO (https://issues.apache.org/jira/browse/ARROW-14153)
-        // pass scan_options_->batch_size
-        return reader_->ReadStripe(i_++, included_fields_);
+        RETURN_NOT_OK(recordBatchReader_->ReadNext(&batch));
+        return batch;
       }
 
-      std::unique_ptr<arrow::adapters::orc::ORCFileReader> reader_;
-      int i_;
-      int num_stripes_;
-      std::vector<std::string> included_fields_;
+      std::shared_ptr<RecordBatchReader> recordBatchReader_;

Review comment:
       Well, some comments still need addressing. Also, could you take a look 
at the CI failures and try to fix them? Thanks! :-)




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