code: func NewAggFunction(funcType string, funcArgs []Expression, distinct bool) AggregationFunction {
  	switch tp := strings.ToLower(funcType); tp {
  	case ast.AggFuncSum:
  		return &sumFunction{aggFunction: newAggFunc(tp, funcArgs, distinct)}
  	case ast.AggFuncCount:
  		return &countFunction{aggFunction: newAggFunc(tp, funcArgs, distinct)}
  	case ast.AggFuncAvg:
  		return &avgFunction{aggFunction: newAggFunc(tp, funcArgs, distinct)}
  	case ast.AggFuncGroupConcat:
  		return &concatFunction{aggFunction: newAggFunc(tp, funcArgs, distinct)}
  	case ast.AggFuncMax:
  		return &maxMinFunction{aggFunction: newAggFunc(tp, funcArgs, distinct), isMax: true}
  	case ast.AggFuncMin:
  		return &maxMinFunction{aggFunction: newAggFunc(tp, funcArgs, distinct), isMax: false}
  	case ast.AggFuncFirstRow:
  		return &firstRowFunction{aggFunction: newAggFunc(tp, funcArgs, distinct)}
  	}
  	return nil
  }
docs: // NewAggFunction creates a new AggregationFunction.