1 | #include "duckdb/catalog/catalog_entry/table_catalog_entry.hpp" |
---|---|
2 | #include "duckdb/execution/operator/persistent/physical_insert.hpp" |
3 | #include "duckdb/execution/physical_plan_generator.hpp" |
4 | #include "duckdb/planner/operator/logical_insert.hpp" |
5 | |
6 | using namespace duckdb; |
7 | using namespace std; |
8 | |
9 | unique_ptr<PhysicalOperator> PhysicalPlanGenerator::CreatePlan(LogicalInsert &op) { |
10 | unique_ptr<PhysicalOperator> plan; |
11 | if (op.children.size() > 0) { |
12 | assert(op.children.size() == 1); |
13 | plan = CreatePlan(*op.children[0]); |
14 | } |
15 | |
16 | dependencies.insert(op.table); |
17 | auto insert = make_unique<PhysicalInsert>(op, op.table, op.column_index_map, move(op.bound_defaults)); |
18 | if (plan) { |
19 | insert->children.push_back(move(plan)); |
20 | } |
21 | return move(insert); |
22 | } |
23 |