kou commented on code in PR #45350:
URL: https://github.com/apache/arrow/pull/45350#discussion_r1931651012


##########
cpp/src/parquet/arrow/reader.cc:
##########
@@ -1025,12 +1025,15 @@ Result<std::unique_ptr<RecordBatchReader>> 
FileReaderImpl::GetRecordBatchReader(
   ::arrow::Iterator<RecordBatchIterator> batches = 
::arrow::MakeFunctionIterator(
       [readers, batch_schema, num_rows,
        this]() mutable -> ::arrow::Result<RecordBatchIterator> {
-        ::arrow::ChunkedArrayVector columns(readers.size());
-
         // don't reserve more rows than necessary
         int64_t batch_size = std::min(properties().batch_size(), num_rows);
-        num_rows -= batch_size;
+        if (batch_size == 0) {
+          // We can return end immediately for 0 batch size
+          return ::arrow::IterationTraits<RecordBatchIterator>::End();
+        }

Review Comment:
   Done.



-- 
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: github-unsubscr...@arrow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to