public static HiveDecimalWritable computeValue(HiveDecimalWritable number) {
    return number == null ? new HiveDecimalWritable(0L)
      : new HiveDecimalWritable(number.isSet() ? number : new HiveDecimalWritable(0L));
  }
VectorPTFEvaluatorHelper is a helper class for vector ptf operations.
ql/src/java/org/apache/hadoop/hive/ql/exec/vector/ptf/VectorPTFEvaluatorHelper.java