| 1107 | }; |
| 1108 | |
| 1109 | Result<std::shared_ptr<TableReader>> MakeTableReader( |
| 1110 | MemoryPool* pool, io::IOContext io_context, std::shared_ptr<io::InputStream> input, |
| 1111 | const ReadOptions& read_options, const ParseOptions& parse_options, |
| 1112 | const ConvertOptions& convert_options) { |
| 1113 | RETURN_NOT_OK(parse_options.Validate()); |
| 1114 | RETURN_NOT_OK(read_options.Validate()); |
| 1115 | RETURN_NOT_OK(convert_options.Validate()); |
| 1116 | std::shared_ptr<BaseTableReader> reader; |
| 1117 | if (read_options.use_threads) { |
| 1118 | auto cpu_executor = arrow::internal::GetCpuThreadPool(); |
| 1119 | reader = std::make_shared<AsyncThreadedTableReader>( |
| 1120 | io_context, input, read_options, parse_options, convert_options, cpu_executor); |
| 1121 | } else { |
| 1122 | reader = std::make_shared<SerialTableReader>(io_context, input, read_options, |
| 1123 | parse_options, convert_options, |
| 1124 | /*count_rows=*/true); |
| 1125 | } |
| 1126 | RETURN_NOT_OK(reader->Init()); |
| 1127 | return reader; |
| 1128 | } |
| 1129 | |
| 1130 | Future<std::shared_ptr<StreamingReader>> MakeStreamingReader( |
| 1131 | io::IOContext io_context, std::shared_ptr<io::InputStream> input, |
no test coverage detected