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

Function MakeTableReader

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

Source from the content-addressed store, hash-verified

1115};
1116
1117Result<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
1138Future<std::shared_ptr<StreamingReader>> MakeStreamingReader(
1139 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