You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/01/13 19:50:49 UTC

[GitHub] [arrow] edponce commented on a change in pull request #12147: ARROW-15318: [C++][Python] Regression reading partition keys of large batches.

edponce commented on a change in pull request #12147:
URL: https://github.com/apache/arrow/pull/12147#discussion_r784277410



##########
File path: cpp/src/arrow/table.cc
##########
@@ -612,7 +612,8 @@ Status TableBatchReader::ReadNext(std::shared_ptr<RecordBatch>* out) {
   }
 
   // Determine the minimum contiguous slice across all columns
-  int64_t chunksize = std::min(table_.num_rows(), max_chunksize_);
+  int64_t chunksize =
+      std::min(table_.num_rows() - absolute_row_position_, max_chunksize_);

Review comment:
       Basically, this adapts for the "loop remainder"
   ```c++
   int64_t i = 0;
   for (; i < table_.num_rows(); i += max_chunksize_) {
     process(max_chunksize_);
   }
   if (i < table_.num_rows()) {
     process(table_num_rows() - 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: github-unsubscribe@arrow.apache.org

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