private static Table loadTable(Configuration conf, String tableIdentifier, String tableLocation,
                                 String catalogName) {
    Optional<Catalog> catalog = loadCatalog(conf, catalogName);

    if (catalog.isPresent()) {
      Preconditions.checkArgument(tableIdentifier != null, "Table identifier not set");
      return catalog.get().loadTable(TableIdentifier.parse(tableIdentifier));
    }

    Preconditions.checkArgument(tableLocation != null, "Table location not set");
    return new HadoopTables(conf).load(tableLocation);
  }
Load an Iceberg table using the catalog specified by the configuration.
<p>
The table identifier ({@link Catalogs#NAME}) and the catalog name ({@link InputFormatConfig#CATALOG_NAME}),
or table path ({@link Catalogs#LOCATION}) should be specified by the controlling properties.
<p>
Used by HiveIcebergSerDe and HiveIcebergStorageHandler.
@param conf a Hadoop configuration
@param props the controlling properties
@return an Iceberg table
iceberg/iceberg-handler/src/main/java/org/apache/iceberg/mr/Catalogs.java