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

Function DoInspectFragment

cpp/src/arrow/dataset/file_csv.cc:429–449  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

427namespace {
428
429Result<std::shared_ptr<InspectedFragment>> DoInspectFragment(
430 const FileSource& source, const CsvFragmentScanOptions& csv_options,
431 compute::ExecContext* exec_context) {
432 ARROW_ASSIGN_OR_RAISE(auto input, source.OpenCompressed());
433 if (csv_options.stream_transform_func) {
434 ARROW_ASSIGN_OR_RAISE(input, csv_options.stream_transform_func(input));
435 }
436 ARROW_ASSIGN_OR_RAISE(
437 input, io::BufferedInputStream::Create(csv_options.read_options.block_size,
438 default_memory_pool(), std::move(input)));
439
440 ARROW_ASSIGN_OR_RAISE(std::string_view first_block,
441 input->Peek(csv_options.read_options.block_size));
442
443 ARROW_ASSIGN_OR_RAISE(
444 std::vector<std::string> column_names,
445 GetOrderedColumnNames(csv_options.read_options, csv_options.parse_options,
446 first_block, exec_context->memory_pool()));
447 return std::make_shared<CsvInspectedFragment>(std::move(column_names), std::move(input),
448 source.Size());
449}
450
451} // namespace
452

Callers 1

InspectFragmentMethod · 0.70

Calls 5

default_memory_poolFunction · 0.85
GetOrderedColumnNamesFunction · 0.85
ARROW_ASSIGN_OR_RAISEFunction · 0.50
memory_poolMethod · 0.45
SizeMethod · 0.45

Tested by

no test coverage detected