MCPcopy Create free account
hub / github.com/apache/arrow / operator()

Function operator()

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

Source from the content-addressed store, hash-verified

168 };
169 struct {
170 Future<std::shared_ptr<RecordBatch>> operator()() {
171 auto state = state_;
172 return ::arrow::DeferNotOk(
173 state->io_executor->Submit([state]() -> Result<std::shared_ptr<RecordBatch>> {
174 if (state->first) {
175 ARROW_ASSIGN_OR_RAISE(auto task, state->iter.Next());
176 ARROW_ASSIGN_OR_RAISE(state->curr_iter, task->Execute());
177 state->first = false;
178 }
179 while (!IsIterationEnd(state->curr_iter)) {
180 ARROW_ASSIGN_OR_RAISE(auto next_batch, state->curr_iter.Next());
181 if (IsIterationEnd(next_batch)) {
182 ARROW_ASSIGN_OR_RAISE(auto task, state->iter.Next());
183 if (IsIterationEnd(task)) {
184 state->curr_iter = IterationEnd<RecordBatchIterator>();
185 } else {
186 ARROW_ASSIGN_OR_RAISE(state->curr_iter, task->Execute());
187 }
188 } else {
189 return next_batch;
190 }
191 }
192 return IterationEnd<std::shared_ptr<RecordBatch>>();
193 }));
194 }
195 std::shared_ptr<IterState> state_;
196 } iter_to_gen{std::shared_ptr<IterState>(
197 new IterState{std::move(task_iter), {}, true, options->io_context.executor()})};

Callers

nothing calls this directly

Calls 4

DeferNotOkFunction · 0.85
IsIterationEndFunction · 0.85
ARROW_ASSIGN_OR_RAISEFunction · 0.50
ExecuteMethod · 0.45

Tested by

no test coverage detected