@HiveDecimalWritableVersionV1
  @Override
  public boolean equals(Object other) {
    if (this == other) {
      return true;
    }
    if (other == null || getClass() != other.getClass()) {
      return false;
    }
    HiveDecimalWritableV1 bdw = (HiveDecimalWritableV1) other;

    // 'equals' and 'compareTo' are not compatible with HiveDecimals. We want
    // compareTo which returns true iff the numbers are equal (e.g.: 3.14 is
    // the same as 3.140). 'Equals' returns true iff equal and the same scale
    // is set in the decimals (e.g.: 3.14 is not the same as 3.140)
    return getHiveDecimal().compareTo(bdw.getHiveDecimal()) == 0;
  }
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