Class Catalogs

java.lang.Object
org.apache.iceberg.mr.Catalogs

public final class Catalogs extends Object
Class for catalog resolution and accessing the common functions for Catalog API.

If the catalog name is provided, get the catalog type from iceberg.catalog.catalogName .type config.

In case the catalog name is location_based_table, type is ignored and tables will be loaded using HadoopTables.

In case the value of catalog type is null, iceberg.catalog.catalogName .catalog-impl config is used to determine the catalog implementation class.

If catalog name is null, get the catalog type from catalog type config:

  • hive: HiveCatalog
  • location: HadoopTables
  • hadoop: HadoopCatalog
  • Field Details

  • Method Details

    • loadTable

      public static Table loadTable(org.apache.hadoop.conf.Configuration conf)
      Load an Iceberg table using the catalog and table identifier (or table path) specified by the configuration.
      Parameters:
      conf - a Hadoop conf
      Returns:
      an Iceberg table
    • loadTable

      public static Table loadTable(org.apache.hadoop.conf.Configuration conf, Properties props)
      Load an Iceberg table using the catalog specified by the configuration.

      The table identifier (NAME) and the catalog name (InputFormatConfig.CATALOG_NAME), or table path (LOCATION) should be specified by the controlling properties.

      Used by HiveIcebergSerDe and HiveIcebergStorageHandler

      Parameters:
      conf - a Hadoop
      props - the controlling properties
      Returns:
      an Iceberg table
    • createTable

      public static Table createTable(org.apache.hadoop.conf.Configuration conf, Properties props)
      Creates an Iceberg table using the catalog specified by the configuration.

      The properties should contain the following values:

      Other properties will be handled over to the Table creation. The controlling properties above will not be propagated.

      Parameters:
      conf - a Hadoop conf
      props - the controlling properties
      Returns:
      the created Iceberg table
    • dropTable

      public static boolean dropTable(org.apache.hadoop.conf.Configuration conf, Properties props)
      Drops an Iceberg table using the catalog specified by the configuration.

      The table identifier (NAME) or table path (LOCATION) should be specified by the controlling properties.

      Parameters:
      conf - a Hadoop conf
      props - the controlling properties
      Returns:
      the created Iceberg table
    • hiveCatalog

      public static boolean hiveCatalog(org.apache.hadoop.conf.Configuration conf, Properties props)
      Returns true if HiveCatalog is used
      Parameters:
      conf - a Hadoop conf
      props - the controlling properties
      Returns:
      true if the Catalog is HiveCatalog