public static Decimal createThriftDecimal(String s) {
    BigDecimal d = new BigDecimal(s);
    return new Decimal((short) d.scale(), ByteBuffer.wrap(d.unscaledValue().toByteArray()));
  }
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