| 269 | } |
| 270 | |
| 271 | Result<TableReaderFactory> MakeAsyncFactory( |
| 272 | std::shared_ptr<internal::ThreadPool> thread_pool = nullptr) { |
| 273 | if (!thread_pool) { |
| 274 | ARROW_ASSIGN_OR_RAISE(thread_pool, internal::ThreadPool::Make(1)); |
| 275 | } |
| 276 | return [thread_pool]( |
| 277 | std::shared_ptr<io::InputStream> input_stream, ParseOptions parse_options, |
| 278 | std::optional<int32_t> block_size) -> Result<std::shared_ptr<TableReader>> { |
| 279 | ReadOptions read_options = ReadOptions::Defaults(); |
| 280 | read_options.use_threads = true; |
| 281 | read_options.block_size = block_size.value_or(1 << 10); |
| 282 | auto table_reader = |
| 283 | TableReader::Make(io::IOContext(thread_pool.get()), input_stream, read_options, |
| 284 | std::move(parse_options), ConvertOptions::Defaults()); |
| 285 | return table_reader; |
| 286 | }; |
| 287 | } |
| 288 | |
| 289 | TEST(AsyncReaderTests, Empty) { |
| 290 | ASSERT_OK_AND_ASSIGN(auto table_factory, MakeAsyncFactory()); |
nothing calls this directly
no test coverage detected