code: func builtinAbs(args []types.Datum, ctx context.Context) (d types.Datum, err error) {
  	d = args[0]
  	switch d.Kind() {
  	case types.KindNull:
  		return d, nil
  	case types.KindUint64:
  		return d, nil
  	case types.KindInt64:
  		iv := d.GetInt64()
  		if iv >= 0 {
  			d.SetInt64(iv)
  			return d, nil
  		}
  		d.SetInt64(-iv)
  		return d, nil
  	default:
  		// we will try to convert other types to float
  		// TODO: if time has no precision, it will be a integer
  		f, err := d.ToFloat64(ctx.GetSessionVars().StmtCtx)
  		d.SetFloat64(math.Abs(f))
  		return d, errors.Trace(err)
  	}
  }
docs: // See http://dev.mysql.com/doc/refman/5.7/en/mathematical-functions.html#function_abs