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

Method Make

cpp/src/arrow/dataset/file_orc.cc:70–94  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

68 Result<RecordBatchIterator> Execute() {
69 struct Impl {
70 static Result<RecordBatchIterator> Make(const FileSource& source,
71 const FileFormat& format,
72 const ScanOptions& scan_options) {
73 ARROW_ASSIGN_OR_RAISE(
74 auto reader,
75 OpenORCReader(source, std::make_shared<ScanOptions>(scan_options)));
76
77 auto materialized_fields = scan_options.MaterializedFields();
78 // filter out virtual columns
79 std::vector<std::string> included_fields;
80 ARROW_ASSIGN_OR_RAISE(auto schema, reader->ReadSchema());
81 for (const auto& ref : materialized_fields) {
82 ARROW_ASSIGN_OR_RAISE(auto match, ref.FindOneOrNone(*schema));
83 if (match.indices().empty()) continue;
84
85 included_fields.push_back(schema->field(match.indices()[0])->name());
86 }
87
88 std::shared_ptr<RecordBatchReader> record_batch_reader;
89 ARROW_ASSIGN_OR_RAISE(
90 record_batch_reader,
91 reader->GetRecordBatchReader(scan_options.batch_size, included_fields));
92
93 return RecordBatchIterator(Impl{std::move(record_batch_reader)});
94 }
95
96 Result<std::shared_ptr<RecordBatch>> Next() {
97 std::shared_ptr<RecordBatch> batch;

Callers

nothing calls this directly

Calls 9

MaterializedFieldsMethod · 0.80
indicesMethod · 0.80
push_backMethod · 0.80
ARROW_ASSIGN_OR_RAISEFunction · 0.50
RecordBatchIteratorClass · 0.50
emptyMethod · 0.45
nameMethod · 0.45
fieldMethod · 0.45
GetRecordBatchReaderMethod · 0.45

Tested by

no test coverage detected