From d21625e5a2c69c73c7a636b32ea35c0d58542a4d Mon Sep 17 00:00:00 2001 From: tiancaiamao Date: Thu, 30 May 2019 23:19:17 +0800 Subject: [PATCH] executor: refine HashAgg.Close when unparallelExec --- executor/aggregate.go | 4 ++-- executor/builder.go | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/executor/aggregate.go b/executor/aggregate.go index d80a83488ce9b..27bda76e3a9fc 100644 --- a/executor/aggregate.go +++ b/executor/aggregate.go @@ -197,7 +197,7 @@ func (e *HashAggExec) Close() error { e.childResult = nil e.groupSet = nil e.partialResultMap = nil - return nil + return e.baseExecutor.Close() } // `Close` may be called after `Open` without calling `Next` in test. if !e.prepared { @@ -214,7 +214,7 @@ func (e *HashAggExec) Close() error { } for range e.finalOutputCh { } - return errors.Trace(e.baseExecutor.Close()) + return e.baseExecutor.Close() } // Open implements the Executor Open interface. diff --git a/executor/builder.go b/executor/builder.go index e11e0e8fc2dda..c66cc5182e665 100644 --- a/executor/builder.go +++ b/executor/builder.go @@ -1019,6 +1019,7 @@ func (b *executorBuilder) buildProjBelowAgg(aggFuncs []*aggregation.AggFuncDesc, return &ProjectionExec{ baseExecutor: newBaseExecutor(b.ctx, expression.NewSchema(projSchemaCols...), projFromID, src), + numWorkers: b.ctx.GetSessionVars().ProjectionConcurrency, evaluatorSuit: expression.NewEvaluatorSuite(projExprs, false), } }