public static HiveDecimalWritable divide(HiveDecimalWritable number, long divisor) {
    if (number == null || divisor == 0) {
      return null;
    }

    HiveDecimalWritable result = new HiveDecimalWritable(number);
    result.mutateDivide(HiveDecimal.create(divisor));
    return result;
  }
VectorPTFEvaluatorHelper is a helper class for vector ptf operations.
ql/src/java/org/apache/hadoop/hive/ql/exec/vector/ptf/VectorPTFEvaluatorHelper.java