@HiveDecimalWritableVersionV1
  public static
  HiveDecimalWritableV1 enforcePrecisionScale(HiveDecimalWritableV1 writable,
                                            int precision, int scale) {
    if (writable == null) {
      return null;
    }

    HiveDecimalV1 dec =
        HiveDecimalV1.enforcePrecisionScale(writable.getHiveDecimal(), precision,
            scale);
    return dec == null ? null : new HiveDecimalWritableV1(dec);
  }
Get a OldHiveDecimal instance from the writable and constraint it with maximum precision/scale.

@param maxPrecision maximum precision
@param maxScale maximum scale
@return OldHiveDecimal instance
storage-api/src/java/org/apache/hadoop/hive/serde2/io/HiveDecimalWritableV1.java