class MetastoreHiveStatisticsProvider implements HiveStatisticsProvider {

    public static OptionalDouble convertPartitionValueToDouble(Type type, Object value)
    {
        if (type.equals(BIGINT) || type.equals(INTEGER) || type.equals(SMALLINT) || type.equals(TINYINT)) {
            return OptionalDouble.of((Long) value);
        }
        if (type.equals(DOUBLE)) {
            return OptionalDouble.of((Double) value);
        }
        if (type.equals(REAL)) {
            return OptionalDouble.of(intBitsToFloat(((Long) value).intValue()));
        }
        if (type instanceof DecimalType) {
            DecimalType decimalType = (DecimalType) type;
            if (isShortDecimal(decimalType)) {
                return OptionalDouble.of(parseDouble(Decimals.toString((Long) value, decimalType.getScale())));
            }
            if (isLongDecimal(decimalType)) {
                return OptionalDouble.of(parseDouble(Decimals.toString((Slice) value, decimalType.getScale())));
            }
            throw new IllegalArgumentException("Unexpected decimal type: " + decimalType);
        }
        if (type.equals(DATE)) {
            return OptionalDouble.of((Long) value);
        }
        return OptionalDouble.empty();
    }

    public  MetastoreHiveStatisticsProvider(SemiTransactionalHiveMetastore metastore);
    @VisibleForTesting  MetastoreHiveStatisticsProvider(PartitionsStatisticsProvider statisticsProvider);

}