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