paleolimbot commented on code in PR #12323:
URL: https://github.com/apache/arrow/pull/12323#discussion_r850428504


##########
r/src/csv.cpp:
##########
@@ -162,7 +164,19 @@ std::shared_ptr<arrow::csv::TableReader> 
csv___TableReader__Make(
 // [[arrow::export]]
 std::shared_ptr<arrow::Table> csv___TableReader__Read(
     const std::shared_ptr<arrow::csv::TableReader>& table_reader) {
-  return ValueOrStop(table_reader->Read());
+  std::thread* thread_ptr;
+  auto result = RunWithCapturedR<std::shared_ptr<arrow::Table>>([&]() {
+    auto fut = arrow::Future<std::shared_ptr<arrow::Table>>::Make();
+
+    thread_ptr = new std::thread([&] { fut.MarkFinished(table_reader->Read()); 
});
+
+    return fut;
+  });
+
+  thread_ptr->join();
+  delete thread_ptr;
+
+  return ValueOrStop(result);
 }

Review Comment:
   Actually, `table_reader->ReadAsync()` seems to crash (or at least the test 
output abruptly ends) on Windows (the method you suggested for the Feather 
reader works fine though).
   
   - 
https://github.com/apache/arrow/runs/5996202038?check_suite_focus=true#step:23:4464
   - 
https://github.com/apache/arrow/runs/5996202147?check_suite_focus=true#step:23:3993
   - 
https://github.com/apache/arrow/runs/5996202233?check_suite_focus=true#step:23:3991



-- 
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-unsubscr...@arrow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to