code: func NewFunction(ctx context.Context, funcName string, retType *types.FieldType, args ...Expression) (Expression, error) {
  	fc, ok := funcs[funcName]
  	if !ok {
  		return nil, errFunctionNotExists.GenByArgs(funcName)
  	}
  	funcArgs := make([]Expression, len(args))
  	copy(funcArgs, args)
  	f, err := fc.getFunction(funcArgs, ctx)
  	if err != nil {
  		return nil, errors.Trace(err)
  	}
  	return &ScalarFunction{
  		FuncName: model.NewCIStr(funcName),
  		RetType:  retType,
  		Function: f,
  	}, nil
  }
docs: // NewFunction creates a new scalar function or constant.