@Override
    public ConnectorMetadata getMetadata() {
        Optional<IHiveMetastore> hiveMetastore = Optional.empty();
        if (isHiveOrGlueCatalogType()) {
            MetastoreType metastoreType = MetastoreType.get(catalogType);
            HiveMetaClient metaClient = HiveMetaClient.createHiveMetaClient(this.hdfsEnvironment, properties);
            hiveMetastore = Optional.of(new HiveMetastore(metaClient, catalogName, metastoreType));
            // TODO caching hiveMetastore support
        }
        return new KuduMetadata(catalogName, hdfsEnvironment, kuduMaster, schemaEmulationEnabled, schemaEmulationPrefix,
                hiveMetastore);
    }
@Test
    public void testGetMetadataWithHiveCatalog() {
        Map<String, String> properties = new HashMap<>();
        properties.put("kudu.master", "localhost:7051");
        properties.put("kudu.catalog.type", "hive");
        properties.put("hive.metastore.uris", "thrift://127.0.0.1:9083");
        KuduConnector connector = new KuduConnector(new ConnectorContext("kudu_catalog", "kudu", properties));

        ConnectorMetadata metadata = connector.getMetadata();
        Assert.assertTrue(metadata instanceof KuduMetadata);
    }