|
32 | 32 | #include "execution/executors/sort_executor.h"
|
33 | 33 | #include "execution/executors/topn_check_executor.h"
|
34 | 34 | #include "execution/executors/topn_executor.h"
|
| 35 | +#include "execution/executors/topn_per_group_executor.h" |
35 | 36 | #include "execution/executors/update_executor.h"
|
36 | 37 | #include "execution/executors/values_executor.h"
|
37 | 38 | #include "execution/executors/window_function_executor.h"
|
38 | 39 | #include "execution/plans/filter_plan.h"
|
39 | 40 | #include "execution/plans/mock_scan_plan.h"
|
40 | 41 | #include "execution/plans/projection_plan.h"
|
41 | 42 | #include "execution/plans/sort_plan.h"
|
| 43 | +#include "execution/plans/topn_per_group_plan.h" |
42 | 44 | #include "execution/plans/topn_plan.h"
|
43 | 45 | #include "execution/plans/values_plan.h"
|
44 | 46 | #include "execution/plans/window_plan.h"
|
@@ -180,6 +182,13 @@ auto ExecutorFactory::CreateExecutor(ExecutorContext *exec_ctx, const AbstractPl
|
180 | 182 | return std::make_unique<TopNExecutor>(exec_ctx, topn_plan, std::move(child));
|
181 | 183 | }
|
182 | 184 |
|
| 185 | + // Create a new groupTopN executor |
| 186 | + case PlanType::TopNPerGroup: { |
| 187 | + const auto *group_topn_plan = dynamic_cast<const TopNPerGroupPlanNode *>(plan.get()); |
| 188 | + auto child = ExecutorFactory::CreateExecutor(exec_ctx, group_topn_plan->GetChildPlan()); |
| 189 | + return std::make_unique<TopNPerGroupExecutor>(exec_ctx, group_topn_plan, std::move(child)); |
| 190 | + } |
| 191 | + |
183 | 192 | default:
|
184 | 193 | UNREACHABLE("Unsupported plan type.");
|
185 | 194 | }
|
|
0 commit comments