### Question:
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(); } MetastoreHiveStatisticsProvider(SemiTransactionalHiveMetastore metastore); @VisibleForTesting  MetastoreHiveStatisticsProvider(PartitionsStatisticsProvider statisticsProvider); @Override TableStatistics getTableStatistics(
            ConnectorSession session,
            SchemaTableName table,
            Map<String, ColumnHandle> columns,
            Map<String, Type> columnTypes,
            List<HivePartition> partitions); static OptionalDouble convertPartitionValueToDouble(Type type, Object value);  }### Answer:
@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", 0.2f); assertConvertPartitionValueToDouble(createDecimalType(5, 2), "123.45", 123.45); assertConvertPartitionValueToDouble(createDecimalType(25, 5), "12345678901234567890.12345", 12345678901234567890.12345); assertConvertPartitionValueToDouble(DATE, "1970-01-02", 1); }