code: func buildSum(aggFuncDesc *aggregation.AggFuncDesc, ordinal int) AggFunc {
  	base := baseSumAggFunc{
  		baseAggFunc: baseAggFunc{
  			args:    aggFuncDesc.Args,
  			ordinal: ordinal,
  		},
  	}
  	switch aggFuncDesc.Mode {
  	case aggregation.DedupMode:
  		return nil
  	default:
  		switch aggFuncDesc.RetTp.EvalType() {
  		case types.ETDecimal:
  			if aggFuncDesc.HasDistinct {
  				return &sum4DistinctDecimal{base}
  			}
  			return &sum4Decimal{base}
  		default:
  			if aggFuncDesc.HasDistinct {
  				return &sum4DistinctFloat64{base}
  			}
  			return &sum4Float64{base}
  		}
  	}
  }
docs: // buildSum builds the AggFunc implementation for function "SUM".