@Override
    public Catalog createCatalog(Context context) {
        final FactoryUtil.CatalogFactoryHelper helper =
                FactoryUtil.createCatalogFactoryHelper(this, context);
        helper.validate();

        return new HiveCatalog(
                context.getName(),
                helper.getOptions().get(DEFAULT_DATABASE),
                helper.getOptions().get(HIVE_CONF_DIR),
                helper.getOptions().get(HADOOP_CONF_DIR),
                helper.getOptions().get(HIVE_VERSION));
    }
@Test
    public void testCreateHiveCatalog() {
        final String catalogName = "mycatalog";

        final HiveCatalog expectedCatalog = HiveTestUtils.createHiveCatalog(catalogName, null);

        final Map<String, String> options = new HashMap<>();
        options.put(CommonCatalogOptions.CATALOG_TYPE.key(), HiveCatalogFactoryOptions.IDENTIFIER);
        options.put(HiveCatalogFactoryOptions.HIVE_CONF_DIR.key(), CONF_DIR.getPath());

        final Catalog actualCatalog =
                FactoryUtil.createCatalog(
                        catalogName, options, null, Thread.currentThread().getContextClassLoader());

        assertThat(
                        ((HiveCatalog) actualCatalog)
                                .getHiveConf()
                                .getVar(HiveConf.ConfVars.METASTOREURIS))
                .isEqualTo("dummy-hms");
        checkEquals(expectedCatalog, (HiveCatalog) actualCatalog);
    }