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

Function DeclarationToTableImpl

cpp/src/arrow/acero/exec_plan.cc:647–665  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

645namespace {
646
647Future<std::shared_ptr<Table>> DeclarationToTableImpl(
648 Declaration declaration, QueryOptions query_options,
649 ::arrow::internal::Executor* cpu_executor) {
650 ExecContext exec_ctx(query_options.memory_pool, cpu_executor,
651 query_options.function_registry);
652 std::shared_ptr<std::shared_ptr<Table>> output_table =
653 std::make_shared<std::shared_ptr<Table>>();
654 ARROW_ASSIGN_OR_RAISE(std::shared_ptr<ExecPlan> exec_plan,
655 ExecPlan::Make(query_options, exec_ctx));
656 TableSinkNodeOptions sink_options(output_table.get());
657 sink_options.sequence_output = query_options.sequence_output;
658 sink_options.names = std::move(query_options.field_names);
659 Declaration with_sink =
660 Declaration::Sequence({declaration, {"table_sink", sink_options}});
661 ARROW_RETURN_NOT_OK(with_sink.AddToPlan(exec_plan.get()));
662 ARROW_RETURN_NOT_OK(exec_plan->Validate());
663 exec_plan->StartProducing();
664 return exec_plan->finished().Then([exec_plan, output_table] { return *output_table; });
665}
666
667Future<std::vector<std::shared_ptr<RecordBatch>>> DeclarationToBatchesImpl(
668 Declaration declaration, QueryOptions options,

Callers 3

DeclarationToBatchesImplFunction · 0.85
DeclarationToTableAsyncFunction · 0.85
DeclarationToTableFunction · 0.85

Calls 8

AddToPlanMethod · 0.80
ThenMethod · 0.80
finishedMethod · 0.80
ARROW_ASSIGN_OR_RAISEFunction · 0.70
MakeFunction · 0.50
getMethod · 0.45
ValidateMethod · 0.45
StartProducingMethod · 0.45

Tested by

no test coverage detected