@VisibleForTesting
    static double convertPartitionValueToDouble(Type type, Object value)
    {
        if (type.equals(BIGINT) || type.equals(INTEGER) || type.equals(SMALLINT) || type.equals(TINYINT)) {
            return (Long) value;
        }
        if (type.equals(DOUBLE)) {
            return (Double) value;
        }
        if (type.equals(REAL)) {
            return intBitsToFloat(((Long) value).intValue());
        }
        if (type instanceof DecimalType) {
            DecimalType decimalType = (DecimalType) type;
            if (isShortDecimal(decimalType)) {
                return parseDouble(Decimals.toString((Long) value, decimalType.getScale()));
            }
            if (isLongDecimal(decimalType)) {
                return parseDouble(Decimals.toString((Slice) value, decimalType.getScale()));
            }
            throw new IllegalArgumentException("Unexpected decimal type: " + decimalType);
        }
        if (type.equals(DATE)) {
            return (Long) value;
        }
        throw new IllegalArgumentException("Unexpected type: " + type);
    }
@Test
    public void testConvertPartitionValueToDouble()
    {
        assertConvertPartitionValueToDouble(BIGINT, "123456", 123456);
        assertConvertPartitionValueToDouble(INTEGER, "12345", 12345);
        assertConvertPartitionValueToDouble(SMALLINT, "1234", 1234);
        assertConvertPartitionValueToDouble(TINYINT, "123", 123);
        assertConvertPartitionValueToDouble(DOUBLE, "0.1", 0.1);
        assertConvertPartitionValueToDouble(REAL, "0.2", (double) (float) 0.2);
        assertConvertPartitionValueToDouble(createDecimalType(5, 2), "123.45", 123.45);
        assertConvertPartitionValueToDouble(createDecimalType(25, 5), "12345678901234567890.12345", 12345678901234567890.12345);
        assertConvertPartitionValueToDouble(DATE, "1970-01-02", 1);
    }