@Override
    public List<String> listPartitionNames(Connection connection, String databaseName, String tableName) {
        String partitionNamesQuery =
                "SELECT PARTITION_DESCRIPTION as NAME FROM INFORMATION_SCHEMA.PARTITIONS WHERE TABLE_SCHEMA = ? " +
                "AND TABLE_NAME = ? AND PARTITION_NAME IS NOT NULL " +
                "AND ( PARTITION_METHOD = 'RANGE' or PARTITION_METHOD = 'RANGE COLUMNS') ORDER BY PARTITION_DESCRIPTION";
        try (PreparedStatement ps = connection.prepareStatement(partitionNamesQuery)) {
            ps.setString(1, databaseName);
            ps.setString(2, tableName);
            ResultSet rs = ps.executeQuery();
            ImmutableList.Builder<String> list = ImmutableList.builder();
            if (null != rs) {
                while (rs.next()) {
                    String[] partitionNames = rs.getString("NAME").
                            replace("'", "").split(",");
                    for (String partitionName : partitionNames) {
                        list.add(partitionName);
                    }
                }
                return list.build();
            } else {
                return Lists.newArrayList();
            }
        } catch (SQLException | NullPointerException e) {
            throw new StarRocksConnectorException(e.getMessage(), e);
        }
    }
@Test
    public void testListPartitionNamesWithCache() {
        try {
            JDBCCacheTestUtil.openCacheEnable(connectContext);
            JDBCMetadata jdbcMetadata = new JDBCMetadata(properties, "catalog", dataSource);
            List<String> partitionNames = jdbcMetadata.listPartitionNames("test", "tbl1", TableVersionRange.empty());
            Assert.assertFalse(partitionNames.isEmpty());
            List<String> partitionNamesWithCache = jdbcMetadata.listPartitionNames("test", "tbl1", TableVersionRange.empty());
            Assert.assertFalse(partitionNamesWithCache.isEmpty());
            JDBCCacheTestUtil.closeCacheEnable(connectContext);
            Map<String, String> properties = new HashMap<>();
            jdbcMetadata.refreshCache(properties);
            List<String> partitionNamesWithOutCache = jdbcMetadata.listPartitionNames("test", "tbl1", TableVersionRange.empty());
            Assert.assertTrue(partitionNamesWithOutCache.isEmpty());
        } catch (Exception e) {
            System.out.println(e.getMessage());
            Assert.fail();
        }
    }