@Override
  public HiveDecimalWritable getWritableConstantValue() {

    // We need to enforce precision/scale here.

    DecimalTypeInfo decTypeInfo = (DecimalTypeInfo) typeInfo;
    HiveDecimalWritable result = new HiveDecimalWritable(value);
    result.mutateEnforcePrecisionScale(decTypeInfo.precision(), decTypeInfo.scale());
    if (!result.isSet()) {
      return null;
    }
    return result;
  }
A WritableConstantHiveDecimalObjectInspector is a WritableHiveDecimalObjectInspector
that implements ConstantObjectInspector.
serde/src/java/org/apache/hadoop/hive/serde2/objectinspector/primitive/WritableConstantHiveDecimalObjectInspector.java