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/06/08 14:34:20 UTC

[GitHub] [arrow] wjones127 commented on a diff in pull request #13338: ARROW-16761: [C++][Python] Track bytes written in dataset

wjones127 commented on code in PR #13338:
URL: https://github.com/apache/arrow/pull/13338#discussion_r892464526


##########
cpp/src/arrow/dataset/file_base.cc:
##########
@@ -265,7 +265,20 @@ Status FileWriter::Write(RecordBatchReader* batches) {
 }
 
 Future<> FileWriter::Finish() {
-  return FinishInternal().Then([this]() { return destination_->CloseAsync(); });
+  return FinishInternal()
+      .Then([this]() {
+        ARROW_ASSIGN_OR_RAISE(bytes_written_, destination_->Tell());
+        return Status::OK();
+      })
+      .Then([this]() { return destination_->CloseAsync(); });

Review Comment:
   I'm new to working with the future. The first closure returns a Status, and the second a Future, so I wasn't sure how to combine them. 



-- 
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