public static Decimal getDecimal(int number, int scale) {
    ByteBuffer bb = ByteBuffer.allocate(4);
    bb.asIntBuffer().put(number);
    return new Decimal((short) scale, bb);
  }
This class contains helper methods for handling thrift api's Decimal
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/api/utils/DecimalUtils.java