public void updatePartitionStatistics(String dbName, String tableName, String partitionName,
                                          Function<HivePartitionStats, HivePartitionStats> update) {
        List<org.apache.hadoop.hive.metastore.api.Partition> partitions = client.getPartitionsByNames(
                dbName, tableName, ImmutableList.of(partitionName));
        if (partitions.size() != 1) {
            throw new StarRocksConnectorException("Metastore returned multiple partitions for name: " + partitionName);
        }

        org.apache.hadoop.hive.metastore.api.Partition originPartition = getOnlyElement(partitions);
        HiveCommonStats curCommonStats = toHiveCommonStats(originPartition.getParameters());
        HivePartitionStats curPartitionStats = new HivePartitionStats(curCommonStats, new HashMap<>());
        HivePartitionStats updatedStats = update.apply(curPartitionStats);

        org.apache.hadoop.hive.metastore.api.Partition modifiedPartition = originPartition.deepCopy();
        HiveCommonStats commonStats = updatedStats.getCommonStats();
        Map<String, String> originParams = modifiedPartition.getParameters();
        originParams.put(TRANSIENT_LAST_DDL_TIME, String.valueOf(System.currentTimeMillis() / 1000));
        modifiedPartition.setParameters(updateStatisticsParameters(modifiedPartition.getParameters(), commonStats));
        client.alterPartition(dbName, tableName, modifiedPartition);

        //TODO(stephen): update partition column statistics
    }
@Test
    public void testUpdatePartitionStatistics() {
        HiveMetaClient client = new MockedHiveMetaClient();
        HiveMetastore metastore = new HiveMetastore(client, "hive_catalog", MetastoreType.HMS);
        HivePartitionStats partitionStats = HivePartitionStats.empty();
        metastore.updatePartitionStatistics("db", "table", "p1=1", ignore -> partitionStats);
    }