zanmato1984 commented on code in PR #47129:
URL: https://github.com/apache/arrow/pull/47129#discussion_r2241391568
##########
cpp/src/arrow/dataset/dataset_writer.cc:
##########
@@ -681,13 +683,13 @@ class DatasetWriter::DatasetWriterImpl {
}
backpressure =
writer_state_->rows_in_flight_throttle.Acquire(next_chunk->num_rows());
- if (!backpressure.is_finished()) {
+ if (backpressure) {
Review Comment:
Can we somewhat assume the completeness of the `backpressure`?
##########
cpp/src/arrow/dataset/dataset_writer.cc:
##########
@@ -63,6 +63,8 @@ class Throttle {
backpressure_ = Future<>::Make();
} else {
current_value_ += values;
+ DCHECK(backpressure_.is_finished());
+ return std::nullopt;
}
return backpressure_;
Review Comment:
Do you think we can early return the `backpressure_` in the `if` branch
above? Since `else` is early returning.
--
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]