Class GlueCatalog

java.lang.Object
org.apache.iceberg.BaseMetastoreCatalog
org.apache.iceberg.aws.glue.GlueCatalog
All Implemented Interfaces:
Closeable, AutoCloseable, org.apache.iceberg.catalog.Catalog, org.apache.iceberg.catalog.SupportsNamespaces, org.apache.iceberg.hadoop.Configurable<org.apache.hadoop.conf.Configuration>

public class GlueCatalog extends org.apache.iceberg.BaseMetastoreCatalog implements org.apache.iceberg.catalog.SupportsNamespaces, org.apache.iceberg.hadoop.Configurable<org.apache.hadoop.conf.Configuration>
  • Nested Class Summary

    Nested classes/interfaces inherited from class org.apache.iceberg.BaseMetastoreCatalog

    org.apache.iceberg.BaseMetastoreCatalog.BaseMetastoreCatalogTableBuilder

    Nested classes/interfaces inherited from interface org.apache.iceberg.catalog.Catalog

    org.apache.iceberg.catalog.Catalog.TableBuilder
  • Constructor Summary

    Constructors
    Constructor
    Description
    No-arg constructor to load the catalog dynamically.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
     
    void
    createNamespace(org.apache.iceberg.catalog.Namespace namespace, Map<String,String> metadata)
     
    protected String
    defaultWarehouseLocation(org.apache.iceberg.catalog.TableIdentifier tableIdentifier)
    This method produces the same result as using a HiveCatalog.
    boolean
    dropNamespace(org.apache.iceberg.catalog.Namespace namespace)
     
    boolean
    dropTable(org.apache.iceberg.catalog.TableIdentifier identifier, boolean purge)
     
    void
    initialize(String name, Map<String,String> properties)
     
    protected boolean
    isValidIdentifier(org.apache.iceberg.catalog.TableIdentifier tableIdentifier)
     
    List<org.apache.iceberg.catalog.Namespace>
    listNamespaces(org.apache.iceberg.catalog.Namespace namespace)
     
    List<org.apache.iceberg.catalog.TableIdentifier>
    listTables(org.apache.iceberg.catalog.Namespace namespace)
     
    loadNamespaceMetadata(org.apache.iceberg.catalog.Namespace namespace)
     
     
    protected org.apache.iceberg.TableOperations
    newTableOps(org.apache.iceberg.catalog.TableIdentifier tableIdentifier)
     
    protected Map<String,String>
     
    boolean
    removeProperties(org.apache.iceberg.catalog.Namespace namespace, Set<String> properties)
     
    void
    renameTable(org.apache.iceberg.catalog.TableIdentifier from, org.apache.iceberg.catalog.TableIdentifier to)
    Rename table in Glue is a drop table and create table.
    void
    setConf(org.apache.hadoop.conf.Configuration conf)
     
    boolean
    setProperties(org.apache.iceberg.catalog.Namespace namespace, Map<String,String> properties)
     

    Methods inherited from class org.apache.iceberg.BaseMetastoreCatalog

    buildTable, fullTableName, isValidMetadataIdentifier, loadTable, metricsReporter, registerTable, toString

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface org.apache.iceberg.catalog.Catalog

    createTable, createTable, createTable, createTable, dropTable, invalidateTable, newCreateTableTransaction, newCreateTableTransaction, newCreateTableTransaction, newCreateTableTransaction, newReplaceTableTransaction, newReplaceTableTransaction, newReplaceTableTransaction, newReplaceTableTransaction, registerTable, tableExists

    Methods inherited from interface org.apache.iceberg.catalog.SupportsNamespaces

    createNamespace, listNamespaces, namespaceExists
  • Constructor Details

    • GlueCatalog

      public GlueCatalog()
      No-arg constructor to load the catalog dynamically.

      All fields are initialized by calling initialize(String, Map) later.

  • Method Details

    • initialize

      public void initialize(String name, Map<String,String> properties)
      Specified by:
      initialize in interface org.apache.iceberg.catalog.Catalog
    • newTableOps

      protected org.apache.iceberg.TableOperations newTableOps(org.apache.iceberg.catalog.TableIdentifier tableIdentifier)
      Specified by:
      newTableOps in class org.apache.iceberg.BaseMetastoreCatalog
    • defaultWarehouseLocation

      protected String defaultWarehouseLocation(org.apache.iceberg.catalog.TableIdentifier tableIdentifier)
      This method produces the same result as using a HiveCatalog. If databaseUri exists for the Glue database URI, the default location is databaseUri/tableName. If not, the default location is warehousePath/databaseName.db/tableName
      Specified by:
      defaultWarehouseLocation in class org.apache.iceberg.BaseMetastoreCatalog
      Parameters:
      tableIdentifier - table id
      Returns:
      default warehouse path
    • listTables

      public List<org.apache.iceberg.catalog.TableIdentifier> listTables(org.apache.iceberg.catalog.Namespace namespace)
      Specified by:
      listTables in interface org.apache.iceberg.catalog.Catalog
    • dropTable

      public boolean dropTable(org.apache.iceberg.catalog.TableIdentifier identifier, boolean purge)
      Specified by:
      dropTable in interface org.apache.iceberg.catalog.Catalog
    • renameTable

      public void renameTable(org.apache.iceberg.catalog.TableIdentifier from, org.apache.iceberg.catalog.TableIdentifier to)
      Rename table in Glue is a drop table and create table.
      Specified by:
      renameTable in interface org.apache.iceberg.catalog.Catalog
      Parameters:
      from - identifier of the table to rename
      to - new table name
    • createNamespace

      public void createNamespace(org.apache.iceberg.catalog.Namespace namespace, Map<String,String> metadata)
      Specified by:
      createNamespace in interface org.apache.iceberg.catalog.SupportsNamespaces
    • listNamespaces

      public List<org.apache.iceberg.catalog.Namespace> listNamespaces(org.apache.iceberg.catalog.Namespace namespace) throws org.apache.iceberg.exceptions.NoSuchNamespaceException
      Specified by:
      listNamespaces in interface org.apache.iceberg.catalog.SupportsNamespaces
      Throws:
      org.apache.iceberg.exceptions.NoSuchNamespaceException
    • loadNamespaceMetadata

      public Map<String,String> loadNamespaceMetadata(org.apache.iceberg.catalog.Namespace namespace) throws org.apache.iceberg.exceptions.NoSuchNamespaceException
      Specified by:
      loadNamespaceMetadata in interface org.apache.iceberg.catalog.SupportsNamespaces
      Throws:
      org.apache.iceberg.exceptions.NoSuchNamespaceException
    • dropNamespace

      public boolean dropNamespace(org.apache.iceberg.catalog.Namespace namespace) throws org.apache.iceberg.exceptions.NamespaceNotEmptyException
      Specified by:
      dropNamespace in interface org.apache.iceberg.catalog.SupportsNamespaces
      Throws:
      org.apache.iceberg.exceptions.NamespaceNotEmptyException
    • setProperties

      public boolean setProperties(org.apache.iceberg.catalog.Namespace namespace, Map<String,String> properties) throws org.apache.iceberg.exceptions.NoSuchNamespaceException
      Specified by:
      setProperties in interface org.apache.iceberg.catalog.SupportsNamespaces
      Throws:
      org.apache.iceberg.exceptions.NoSuchNamespaceException
    • removeProperties

      public boolean removeProperties(org.apache.iceberg.catalog.Namespace namespace, Set<String> properties) throws org.apache.iceberg.exceptions.NoSuchNamespaceException
      Specified by:
      removeProperties in interface org.apache.iceberg.catalog.SupportsNamespaces
      Throws:
      org.apache.iceberg.exceptions.NoSuchNamespaceException
    • isValidIdentifier

      protected boolean isValidIdentifier(org.apache.iceberg.catalog.TableIdentifier tableIdentifier)
      Overrides:
      isValidIdentifier in class org.apache.iceberg.BaseMetastoreCatalog
    • name

      public String name()
      Specified by:
      name in interface org.apache.iceberg.catalog.Catalog
    • close

      public void close() throws IOException
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Overrides:
      close in class org.apache.iceberg.BaseMetastoreCatalog
      Throws:
      IOException
    • setConf

      public void setConf(org.apache.hadoop.conf.Configuration conf)
      Specified by:
      setConf in interface org.apache.iceberg.hadoop.Configurable<org.apache.hadoop.conf.Configuration>
    • properties

      protected Map<String,String> properties()
      Overrides:
      properties in class org.apache.iceberg.BaseMetastoreCatalog