@@ -9,7 +9,7 @@ namespace NYql {
99class TAggregateExpander {
1010public:
1111 TAggregateExpander (bool usePartitionsByKeys, const bool useFinalizeByKeys, const TExprNode::TPtr& node, TExprContext& ctx, TTypeAnnotationContext& typesCtx,
12- bool forceCompact = false , bool compactForDistinct = false , bool usePhases = false , bool allowSpilling = false )
12+ bool forceCompact = false , bool compactForDistinct = false , bool usePhases = false , bool useBlocks = false )
1313 : Node(node)
1414 , Ctx(ctx)
1515 , TypesCtx(typesCtx)
@@ -25,7 +25,7 @@ class TAggregateExpander {
2525 , HaveSessionSetting(false )
2626 , OriginalRowType(nullptr )
2727 , RowType(nullptr )
28- , UseBlocks(typesCtx.IsBlockEngineEnabled() && !allowSpilling )
28+ , UseBlocks(useBlocks )
2929 {
3030 PreMap = Ctx.Builder (node->Pos ())
3131 .Lambda ()
@@ -135,7 +135,7 @@ class TAggregateExpander {
135135inline TExprNode::TPtr ExpandAggregatePeepholeImpl (const TExprNode::TPtr& node, TExprContext& ctx, TTypeAnnotationContext& typesCtx,
136136 const bool useFinalizeByKey, const bool useBlocks, const bool allowSpilling) {
137137 TAggregateExpander aggExpander (!useFinalizeByKey && !useBlocks, useFinalizeByKey, node, ctx, typesCtx,
138- true , false , false , allowSpilling);
138+ true , false , false , typesCtx. IsBlockEngineEnabled () && ! allowSpilling);
139139 return aggExpander.ExpandAggregate ();
140140}
141141
0 commit comments