public static Catalog buildCatalog()

in iceberg-catalog-migrator/api/src/main/java/org/apache/polaris/iceberg/catalog/migrator/api/CatalogMigrationUtil.java [51:71]


  public static Catalog buildCatalog(
      Map<String, String> catalogProperties,
      CatalogType catalogType,
      String catalogName,
      String customCatalogImpl,
      Map<String, String> hadoopConf) {
    Preconditions.checkArgument(catalogProperties != null, "catalog properties is null");
    Preconditions.checkArgument(catalogType != null, "catalog type is null");
    Configuration catalogConf = new Configuration();
    if (hadoopConf != null) {
      hadoopConf.forEach(catalogConf::set);
    }
    if (catalogProperties.get("name") != null) {
      // Some catalogs like jdbc stores the catalog name from the client when the namespace or table
      // is created.
      // Hence, when accessing the tables from another client, catalog name should match.
      catalogName = catalogProperties.get("name");
    }
    return CatalogUtil.loadCatalog(
        catalogImpl(catalogType, customCatalogImpl), catalogName, catalogProperties, catalogConf);
  }