@Override
  protected HiveDecimalWritable evaluate(HiveDecimal left, HiveDecimal right) {
    if (right.compareTo(HiveDecimal.ZERO) == 0) {
      return null;
    }

    HiveDecimal dec = left.divide(right);
    if (dec == null) {
      return null;
    }

    decimalWritable.set(dec);
    return decimalWritable;
  }
Note that in SQL, the return type of divide is not necessarily the same
as the parameters. For example, 3 / 2 = 1.5, not 1. To follow SQL, we always
return a decimal for divide.
ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFOPDivide.java