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

Function DoInspectFragment

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

Source from the content-addressed store, hash-verified

441namespace {
442
443Result<std::shared_ptr<InspectedFragment>> DoInspectFragment(
444 const FileSource& source, const CsvFragmentScanOptions& csv_options,
445 compute::ExecContext* exec_context) {
446 ARROW_ASSIGN_OR_RAISE(auto input, source.OpenCompressed());
447 if (csv_options.stream_transform_func) {
448 ARROW_ASSIGN_OR_RAISE(input, csv_options.stream_transform_func(input));
449 }
450 ARROW_ASSIGN_OR_RAISE(
451 input, io::BufferedInputStream::Create(csv_options.read_options.block_size,
452 default_memory_pool(), std::move(input)));
453
454 ARROW_ASSIGN_OR_RAISE(std::string_view first_block,
455 input->Peek(csv_options.read_options.block_size));
456
457 ARROW_ASSIGN_OR_RAISE(
458 std::vector<std::string> column_names,
459 GetOrderedColumnNames(csv_options.read_options, csv_options.parse_options,
460 first_block, exec_context->memory_pool()));
461 return std::make_shared<CsvInspectedFragment>(std::move(column_names), std::move(input),
462 source.Size());
463}
464
465} // namespace
466

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