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