From 1dbee2dc6d33cc652897b63c4fbfbcc2e8abca1b Mon Sep 17 00:00:00 2001 From: Haibin Xie Date: Thu, 3 Jan 2019 19:44:22 +0800 Subject: [PATCH] refine code comments --- executor/window.go | 3 +-- expression/aggregation/base_func.go | 2 +- planner/core/logical_plan_builder.go | 1 + 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/executor/window.go b/executor/window.go index 7d19afaa90215..99ee1005b151e 100644 --- a/executor/window.go +++ b/executor/window.go @@ -140,8 +140,7 @@ func (e *WindowExec) fetchChildIfNecessary(ctx context.Context, chk *chunk.Chunk return nil } -// appendResult2Chunk appends result of all the aggregation functions to the -// result chunk, and reset the evaluation context for each aggregation. +// appendResult2Chunk appends result of the window function to the result chunk. func (e *WindowExec) appendResult2Chunk(chk *chunk.Chunk) error { e.copyChk(chk) var err error diff --git a/expression/aggregation/base_func.go b/expression/aggregation/base_func.go index 400ca2210a902..803856304f029 100644 --- a/expression/aggregation/base_func.go +++ b/expression/aggregation/base_func.go @@ -230,7 +230,7 @@ func (a *baseFuncDesc) WrapCastForAggArgs(ctx sessionctx.Context) { case types.ETDecimal: castFunc = expression.WrapWithCastAsDecimal default: - panic("should never happen in executorBuilder.wrapCastForAggArgs") + panic("should never happen in baseFuncDesc.WrapCastForAggArgs") } for i := range a.Args { a.Args[i] = castFunc(ctx, a.Args[i]) diff --git a/planner/core/logical_plan_builder.go b/planner/core/logical_plan_builder.go index 34add28defaaf..68ba0b96bd4f0 100644 --- a/planner/core/logical_plan_builder.go +++ b/planner/core/logical_plan_builder.go @@ -2662,6 +2662,7 @@ func (b *PlanBuilder) buildWindowFunction(p LogicalPlan, expr *ast.WindowFuncExp } desc := aggregation.NewWindowFuncDesc(b.ctx, expr.F, args) + // TODO: Check if the function is aggregation function after we support more functions. desc.WrapCastForAggArgs(b.ctx) lenPartition := 0 if expr.Spec.PartitionBy != nil {