public static NullableValue parsePartitionValue(HivePartitionKey key, Type type, DateTimeZone timeZone)
    {
        return parsePartitionValue(key.getName(), key.getValue().orElse(HIVE_DEFAULT_DYNAMIC_PARTITION), type, timeZone);
    }
@Test
    public void testParsePartitionValue()
    {
        Object prestoValue = parsePartitionValue("p=1970-01-02", "1970-01-02", DATE, ZoneId.of(TimeZone.getDefault().getID())).getValue();
        assertEquals(Long.parseLong(String.valueOf(prestoValue)), 1L);

        prestoValue = parsePartitionValue("p=1234", "1234", INTEGER, ZoneId.of(TimeZone.getDefault().getID())).getValue();
        assertEquals(Integer.parseInt(String.valueOf(prestoValue)), 1234);

        prestoValue = parsePartitionValue("p=true", "true", BOOLEAN, ZoneId.of(TimeZone.getDefault().getID())).getValue();
        assertTrue(Boolean.parseBoolean(String.valueOf(prestoValue)));

        prestoValue = parsePartitionValue("p=USA", "USA", VARCHAR, ZoneId.of(TimeZone.getDefault().getID())).getValue();
        assertEquals(prestoValue, Slices.utf8Slice("USA"));
    }