Skip to content

Commit

Permalink
refine code comments
Browse files Browse the repository at this point in the history
  • Loading branch information
alivxxx committed Jan 3, 2019
1 parent 3eca104 commit 1dbee2d
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
3 changes: 1 addition & 2 deletions executor/window.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion expression/aggregation/base_func.go
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand Down
1 change: 1 addition & 0 deletions planner/core/logical_plan_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 1dbee2d

Please sign in to comment.