mapleFU commented on code in PR #39995:
URL: https://github.com/apache/arrow/pull/39995#discussion_r1482439598
##########
cpp/src/arrow/dataset/dataset_writer.cc:
##########
@@ -610,31 +610,34 @@ class DatasetWriter::DatasetWriterImpl {
bool will_open_file = false;
ARROW_ASSIGN_OR_RAISE(auto next_chunk, dir_queue->NextWritableChunk(
batch, &remainder,
&will_open_file));
-
- backpressure =
-
writer_state_.rows_in_flight_throttle.Acquire(next_chunk->num_rows());
- if (!backpressure.is_finished()) {
-
EVENT_ON_CURRENT_SPAN("DatasetWriter::Backpressure::TooManyRowsQueued");
- break;
- }
- if (will_open_file) {
- backpressure = writer_state_.open_files_throttle.Acquire(1);
+ // GH-39965: `NextWritableChunk` may return empty batch if file reaches
+ // `max_rows_per_file`.
+ if (next_chunk->num_rows() > 0) {
Review Comment:
( This problem would happen when file already reaches `max_rows_per_file`,
the `next_chunk` in this round would be 0, causing a zero-sized batch)
--
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]