1#include "duckdb/execution/physical_plan_generator.hpp"
2#include "duckdb/planner/logical_operator.hpp"
3#include "duckdb/planner/operator/logical_simple.hpp"
4
5#include "duckdb/execution/operator/helper/physical_pragma.hpp"
6#include "duckdb/execution/operator/helper/physical_transaction.hpp"
7#include "duckdb/execution/operator/schema/physical_alter.hpp"
8#include "duckdb/execution/operator/schema/physical_create_schema.hpp"
9#include "duckdb/execution/operator/schema/physical_create_sequence.hpp"
10#include "duckdb/execution/operator/schema/physical_create_view.hpp"
11#include "duckdb/execution/operator/schema/physical_drop.hpp"
12#include "duckdb/execution/operator/helper/physical_vacuum.hpp"
13
14using namespace duckdb;
15using namespace std;
16
17unique_ptr<PhysicalOperator> PhysicalPlanGenerator::CreatePlan(LogicalSimple &op) {
18 switch (op.type) {
19 case LogicalOperatorType::ALTER:
20 return make_unique<PhysicalAlter>(unique_ptr_cast<ParseInfo, AlterInfo>(move(op.info)));
21 case LogicalOperatorType::DROP:
22 return make_unique<PhysicalDrop>(unique_ptr_cast<ParseInfo, DropInfo>(move(op.info)));
23 case LogicalOperatorType::PRAGMA:
24 return make_unique<PhysicalPragma>(unique_ptr_cast<ParseInfo, PragmaInfo>(move(op.info)));
25 case LogicalOperatorType::TRANSACTION:
26 return make_unique<PhysicalTransaction>(unique_ptr_cast<ParseInfo, TransactionInfo>(move(op.info)));
27 case LogicalOperatorType::VACUUM:
28 return make_unique<PhysicalVacuum>(unique_ptr_cast<ParseInfo, VacuumInfo>(move(op.info)));
29 default:
30 throw NotImplementedException("Unimplemented type for logical simple operator");
31 }
32}
33