presto-spi/src/main/java/io/prestosql/spi/type/Decimals.java/Decimals/readBigDecimal
class Decimals:    public static BigDecimal readBigDecimal(DecimalType type, Block block, int position)
    {
        BigInteger unscaledValue = type.isShort()
                ? BigInteger.valueOf(type.getLong(block, position))
                : decodeUnscaledValue(type.getSlice(block, position));
        return new BigDecimal(unscaledValue, type.getScale(), new MathContext(type.getPrecision()));
    }