public static Range<PartitionKey> createRange(String lowerBound, String upperBound, Column partitionColumn)
            throws AnalysisException {
        if (lowerBound == null && upperBound == null) {
            return null;
        }
        PartitionValue lowerValue = new PartitionValue(lowerBound);
        PartitionValue upperValue;
        if (upperBound.equalsIgnoreCase(MaxLiteral.MAX_VALUE.toString())) {
            upperValue = PartitionValue.MAX_VALUE;
        } else {
            upperValue = new PartitionValue(upperBound);
        }
        PartitionKey lowerBoundPartitionKey = PartitionKey.createPartitionKey(Collections.singletonList(lowerValue),
                Collections.singletonList(partitionColumn));
        PartitionKey upperBoundPartitionKey = PartitionKey.createPartitionKey(Collections.singletonList(upperValue),
                Collections.singletonList(partitionColumn));
        return Range.closedOpen(lowerBoundPartitionKey, upperBoundPartitionKey);
    }
@Test
    public void testMappingRangeList() throws AnalysisException {
        Map<String, Range<PartitionKey>> baseRangeMap = Maps.newHashMap();
        Map<String, Range<PartitionKey>> result;
        baseRangeMap.put("p202001", createRange("2020-01-01", "2020-02-01"));
        baseRangeMap.put("p202002", createRange("2020-02-01", "2020-03-01"));
        baseRangeMap.put("p202003", createRange("2020-03-01", "2020-04-01"));
        baseRangeMap.put("p202004", createMaxValueRange("2020-04-01"));

        result = toEagerMappingRanges(baseRangeMap, "month", PrimitiveType.DATE);

        Assert.assertTrue(result.containsKey("p202004_999912"));
        Assert.assertEquals(1, result.get("p202004_999912").upperEndpoint().getKeys().size());
        Assert.assertEquals("9999-12-31", result.get("p202004_999912").upperEndpoint().getKeys().get(0).
                getStringValue());

        baseRangeMap.clear();
        baseRangeMap.put("p202001", createRange("2020-01-01 12:00:25", "2020-02-01 20:01:59"));
        baseRangeMap.put("p202002", createRange("2020-02-01 20:01:59", "2020-03-01 02:50:49"));
        baseRangeMap.put("p202003", createRange("2020-03-01 02:50:49", "2020-04-01 01:05:06"));
        baseRangeMap.put("p202004", createMaxValueRange("2020-04-01 01:05:06"));
        result = toEagerMappingRanges(baseRangeMap, "hour", PrimitiveType.DATETIME);
        Assert.assertTrue(result.size() == 2175);
    }