@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 testCreateHiveCatalogWithIllegalHadoopConfDir() throws IOException {
        final String catalogName = "mycatalog";

        final String hadoopConfDir = tempFolder.newFolder().getAbsolutePath();
        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());
        options.put(HiveCatalogFactoryOptions.HADOOP_CONF_DIR.key(), hadoopConfDir);

        assertThatThrownBy(
                        () ->
                                FactoryUtil.createCatalog(
                                        catalogName,
                                        options,
                                        null,
                                        Thread.currentThread().getContextClassLoader()))
                .isInstanceOf(ValidationException.class);
    }