benibus commented on code in PR #14355:
URL: https://github.com/apache/arrow/pull/14355#discussion_r1041165926


##########
cpp/src/arrow/json/reader.cc:
##########
@@ -183,35 +493,47 @@ Result<std::shared_ptr<TableReader>> TableReader::Make(
   return ptr;
 }
 
+Future<std::shared_ptr<StreamingReader>> StreamingReader::MakeAsync(
+    std::shared_ptr<io::InputStream> stream, const ReadOptions& read_options,
+    const ParseOptions& parse_options, const io::IOContext& io_context,
+    Executor* cpu_executor) {
+  auto future = StreamingReaderImpl::MakeAsync(
+      std::make_shared<DecodeContext>(parse_options, io_context.pool()),
+      std::move(stream), io_context, cpu_executor, read_options);
+  return future.Then([](const std::shared_ptr<StreamingReaderImpl>& reader) {
+    return std::static_pointer_cast<StreamingReader>(reader);
+  });
+}
+
+Result<std::shared_ptr<StreamingReader>> StreamingReader::Make(
+    std::shared_ptr<io::InputStream> stream, const ReadOptions& read_options,
+    const ParseOptions& parse_options, const io::IOContext& io_context,
+    Executor* cpu_executor) {
+  auto future =
+      MakeAsync(std::move(stream), read_options, parse_options, io_context, 
cpu_executor);
+  return future.result();

Review Comment:
   Yeah, I did consider having separate `Make` and `Open` methods for that 
reason, but I got the impression that partial instantiation might be at-odds 
with the base API.



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