code: func (af *avgFunction) Update(evalCtx *AggEvaluateContext, sc *stmtctx.StatementContext, row chunk.Row) (err error) {
  	switch af.Mode {
  	case Partial1Mode, CompleteMode:
  		err = af.updateSum(sc, evalCtx, row)
  	case Partial2Mode, FinalMode:
  		err = af.updateAvg(sc, evalCtx, row)
  	case DedupMode:
  		panic("DedupMode is not supported now.")
  	}
  	return err
  }
docs: // Update implements Aggregation interface.