@@ -38,6 +38,7 @@ class TDqsPhysicalOptProposalTransformer : public TOptimizeTransformerBase {
38
38
AddHandler (0 , &TCoPartitionByKey::Match, HNDL (BuildPartitionStage<false >));
39
39
AddHandler (0 , &TCoAsList::Match, HNDL (BuildAggregationResultStage));
40
40
AddHandler (0 , &TCoTopSort::Match, HNDL (BuildTopSortStage<false >));
41
+ AddHandler (0 , &TCoTop::Match, HNDL (BuildTopStage<false >));
41
42
AddHandler (0 , &TCoSort::Match, HNDL (BuildSortStage<false >));
42
43
AddHandler (0 , &TCoTakeBase::Match, HNDL (BuildTakeOrTakeSkipStage<false >));
43
44
AddHandler (0 , &TCoLength::Match, HNDL (RewriteLengthOfStageOutput<false >));
@@ -74,6 +75,7 @@ class TDqsPhysicalOptProposalTransformer : public TOptimizeTransformerBase {
74
75
AddHandler (1 , &TCoFinalizeByKey::Match, HNDL (BuildFinalizeByKeyStage<true >));
75
76
AddHandler (1 , &TCoPartitionByKey::Match, HNDL (BuildPartitionStage<true >));
76
77
AddHandler (1 , &TCoTopSort::Match, HNDL (BuildTopSortStage<true >));
78
+ AddHandler (1 , &TCoTop::Match, HNDL (BuildTopStage<true >));
77
79
AddHandler (1 , &TCoSort::Match, HNDL (BuildSortStage<true >));
78
80
AddHandler (1 , &TCoTakeBase::Match, HNDL (BuildTakeOrTakeSkipStage<true >));
79
81
AddHandler (1 , &TCoLength::Match, HNDL (RewriteLengthOfStageOutput<true >));
@@ -184,6 +186,11 @@ class TDqsPhysicalOptProposalTransformer : public TOptimizeTransformerBase {
184
186
return DqBuildTopSortStage (node, ctx, optCtx, *getParents (), IsGlobal);
185
187
}
186
188
189
+ template <bool IsGlobal>
190
+ TMaybeNode<TExprBase> BuildTopStage (TExprBase node, TExprContext& ctx, IOptimizationContext& optCtx, const TGetParents& getParents) {
191
+ return DqBuildTopStage (node, ctx, optCtx, *getParents (), IsGlobal);
192
+ }
193
+
187
194
template <bool IsGlobal>
188
195
TMaybeNode<TExprBase> BuildSortStage (TExprBase node, TExprContext& ctx, IOptimizationContext& optCtx, const TGetParents& getParents) {
189
196
return DqBuildSortStage (node, ctx, optCtx, *getParents (), IsGlobal);
0 commit comments