pitrou commented on code in PR #14355:
URL: https://github.com/apache/arrow/pull/14355#discussion_r1041215236
##########
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:
Right, let's keep it like this for now.
--
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]