@Override
    public HiveDecimalWritable div(HiveDecimalWritable sum, long numRows) {
      if (sum == null || numRows == 0) {
        return null;
      }

      HiveDecimalWritable result = new HiveDecimalWritable(sum);
      result.mutateDivide(HiveDecimal.create(numRows));
      return result;
    }
Define some type specific operation to used in the subclass
ql/src/java/org/apache/hadoop/hive/ql/udf/ptf/BasePartitionEvaluator.java