1#include "duckdb/execution/operator/order/physical_top_n.hpp"
2#include "duckdb/execution/physical_plan_generator.hpp"
3#include "duckdb/planner/operator/logical_top_n.hpp"
4
5namespace duckdb {
6
7unique_ptr<PhysicalOperator> PhysicalPlanGenerator::CreatePlan(LogicalTopN &op) {
8 D_ASSERT(op.children.size() == 1);
9
10 auto plan = CreatePlan(op&: *op.children[0]);
11
12 auto top_n =
13 make_uniq<PhysicalTopN>(args&: op.types, args: std::move(op.orders), args: (idx_t)op.limit, args&: op.offset, args&: op.estimated_cardinality);
14 top_n->children.push_back(x: std::move(plan));
15 return std::move(top_n);
16}
17
18} // namespace duckdb
19