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

Class Generator

cpp/src/arrow/dataset/dataset.cc:135–150  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

133 };
134
135 struct Generator {
136 Generator(std::shared_ptr<InMemoryFragment> fragment, int64_t batch_size)
137 : state(std::make_shared<State>(std::move(fragment), batch_size)) {}
138
139 Future<std::shared_ptr<RecordBatch>> operator()() {
140 while (!state->Finished()) {
141 auto next = state->Next();
142 if (next) {
143 return Future<std::shared_ptr<RecordBatch>>::MakeFinished(std::move(next));
144 }
145 }
146 return AsyncGeneratorEnd<std::shared_ptr<RecordBatch>>();
147 }
148
149 std::shared_ptr<State> state;
150 };
151 return Generator(checked_pointer_cast<InMemoryFragment>(shared_from_this()),
152 options->batch_size);
153}

Callers 1

ScanBatchesAsyncMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected