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

Function MakeTableReader

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

Source from the content-addressed store, hash-verified

1113};
1114
1115Result<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
1136Future<std::shared_ptr<StreamingReader>> MakeStreamingReader(
1137 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