MCPcopy Create free account
hub / github.com/apache/arrow / MakeTableReader

Function MakeTableReader

cpp/src/arrow/csv/reader.cc:1109–1128  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1107};
1108
1109Result<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
1130Future<std::shared_ptr<StreamingReader>> MakeStreamingReader(
1131 io::IOContext io_context, std::shared_ptr<io::InputStream> input,

Callers 1

MakeMethod · 0.85

Calls 3

GetCpuThreadPoolFunction · 0.85
ValidateMethod · 0.45
InitMethod · 0.45

Tested by

no test coverage detected