1#include "duckdb/execution/operator/join/physical_positional_join.hpp"
2#include "duckdb/execution/operator/scan/physical_positional_scan.hpp"
3#include "duckdb/execution/physical_plan_generator.hpp"
4#include "duckdb/planner/operator/logical_positional_join.hpp"
5
6namespace duckdb {
7
8unique_ptr<PhysicalOperator> PhysicalPlanGenerator::CreatePlan(LogicalPositionalJoin &op) {
9 D_ASSERT(op.children.size() == 2);
10
11 auto left = CreatePlan(op&: *op.children[0]);
12 auto right = CreatePlan(op&: *op.children[1]);
13 switch (left->type) {
14 case PhysicalOperatorType::TABLE_SCAN:
15 case PhysicalOperatorType::POSITIONAL_SCAN:
16 switch (right->type) {
17 case PhysicalOperatorType::TABLE_SCAN:
18 case PhysicalOperatorType::POSITIONAL_SCAN:
19 return make_uniq<PhysicalPositionalScan>(args&: op.types, args: std::move(left), args: std::move(right));
20 default:
21 break;
22 }
23 default:
24 break;
25 }
26
27 return make_uniq<PhysicalPositionalJoin>(args&: op.types, args: std::move(left), args: std::move(right), args&: op.estimated_cardinality);
28}
29
30} // namespace duckdb
31