pitrou commented on code in PR #46711:
URL: https://github.com/apache/arrow/pull/46711#discussion_r2141754772
##########
cpp/src/arrow/dataset/dataset_writer.cc:
##########
@@ -217,21 +227,26 @@ class DatasetWriterFileQueue {
Status Finish() {
writer_state_->staged_rows_count -= rows_currently_staged_;
while (!staged_batches_.empty()) {
- RETURN_NOT_OK(PopAndDeliverStagedBatch());
+ auto st = PopAndDeliverStagedBatch().status();
+ if (!st.ok()) {
+ file_tasks_.reset();
+ return st;
+ }
Review Comment:
Well, I'm not sure `RETURN_NOT_OK_AFTER` would be much less confusing,
honestly.
I wonder if we can add some kind of functional API to `Status`, for example:
```c++
RETURN_NOT_OK(PopAndDeliverStagedBatch().OrElse([&] {
file_tasks_.reset() }));
```
--
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]