@Override
    public boolean partitionExists(Table table, List<String> partitionValues) {
        HiveTable hiveTable = (HiveTable) table;
        String dbName = hiveTable.getDbName();
        String tableName = hiveTable.getTableName();
        if (metastoreType == MetastoreType.GLUE && hiveTable.hasBooleanTypePartitionColumn()) {
            List<String> allPartitionNames = client.getPartitionKeys(dbName, tableName);
            String hivePartitionName = toHivePartitionName(hiveTable.getPartitionColumnNames(), partitionValues);
            return allPartitionNames.contains(hivePartitionName);
        } else {
            return !client.getPartitionKeysByValue(dbName, tableName, partitionValues).isEmpty();
        }
    }
@Test
    public void testPartitionExists() {
        HiveMetaClient client = new MockedHiveMetaClient();
        HiveMetastore metastore = new HiveMetastore(client, "hive_catalog", MetastoreType.HMS);
        Assert.assertTrue(metastore.partitionExists(metastore.getTable("db1", "tbl1"), new ArrayList<>()));
    }