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/05/25 23:10:52 UTC

[GitHub] [arrow] lidavidm commented on a diff in pull request #13205: ARROW-16515: [C++] Adding a Close method to RecordBatchReader

lidavidm commented on code in PR #13205:
URL: https://github.com/apache/arrow/pull/13205#discussion_r882190050


##########
cpp/src/arrow/compute/exec/exec_plan.cc:
##########
@@ -464,6 +464,13 @@ std::shared_ptr<RecordBatchReader> MakeGeneratorReader(
     std::shared_ptr<Schema> schema,
     std::function<Future<util::optional<ExecBatch>>()> gen, MemoryPool* pool) {
   struct Impl : RecordBatchReader {
+    ~Impl() {
+      auto st = this->Close();
+      if (!st.ok()) {
+        ARROW_LOG(WARNING) << "MakeGeneratorReader failed in finalzing reading.";
+      }

Review Comment:
   Agreed, this should just be the default. I would also make the message clear that it's because Close() was not explicitly called, and include the status in the message. 



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