Class IcebergCatalogAdapter

java.lang.Object
io.deephaven.iceberg.util.IcebergCatalogAdapter

public class IcebergCatalogAdapter extends Object
  • Method Details

    • listNamespaces

      public List<org.apache.iceberg.catalog.Namespace> listNamespaces()
      List all namespaces in the catalog. This method is only supported if the catalog implements SupportsNamespaces for namespace discovery. See SupportsNamespaces.listNamespaces(Namespace).
      Returns:
      A list of all namespaces.
    • listNamespaces

      public List<org.apache.iceberg.catalog.Namespace> listNamespaces(@NotNull @NotNull org.apache.iceberg.catalog.Namespace namespace)
      List all namespaces in a given namespace. This method is only supported if the catalog implements SupportsNamespaces for namespace discovery. See SupportsNamespaces.listNamespaces(Namespace).
      Parameters:
      namespace - The namespace to list namespaces in.
      Returns:
      A list of all namespaces in the given namespace.
    • namespaces

      public Table namespaces()
      List all namespaces in the catalog as a Deephaven table. The resulting table will be static and contain the same information as listNamespaces().
      Returns:
      A table of all namespaces.
    • namespaces

      public Table namespaces(@NotNull @NotNull org.apache.iceberg.catalog.Namespace namespace)
      List all namespaces in a given namespace as a Deephaven table. The resulting table will be static and contain the same information as listNamespaces(Namespace).
      Returns:
      A table of all namespaces.
    • namespaces

      public Table namespaces(@NotNull @NotNull String... namespace)
      List all namespaces in a given namespace as a Deephaven table. The resulting table will be static and contain the same information as listNamespaces(Namespace).
      Returns:
      A table of all namespaces.
    • listTables

      public List<org.apache.iceberg.catalog.TableIdentifier> listTables(@NotNull @NotNull org.apache.iceberg.catalog.Namespace namespace)
      List all Iceberg tables in a given namespace.
      Parameters:
      namespace - The namespace to list tables in.
      Returns:
      A list of all tables in the given namespace.
    • tables

      public Table tables(@NotNull @NotNull org.apache.iceberg.catalog.Namespace namespace)
      List all Iceberg tables in a given namespace as a Deephaven table. The resulting table will be static and contain the same information as listTables(Namespace).
      Parameters:
      namespace - The namespace from which to gather the tables
      Returns:
      A list of all tables in the given namespace.
    • tables

      public Table tables(@NotNull @NotNull String... namespace)
    • loadTable

      public IcebergTableAdapter loadTable(String tableIdentifier)
      Load an Iceberg table from the catalog.

      Equivalent to loadTable(LoadTableOptions.builder().id(tableIdentifier).build()).

      Parameters:
      tableIdentifier - The identifier of the table to load.
      Returns:
      The table adapter for the Iceberg table.
      See Also:
    • loadTable

      public IcebergTableAdapter loadTable(@NotNull @NotNull org.apache.iceberg.catalog.TableIdentifier tableIdentifier)
      Load an Iceberg table from the catalog.

      Equivalent to loadTable(LoadTableOptions.builder().id(tableIdentifier).build()).

      Parameters:
      tableIdentifier - The identifier of the table to load.
      Returns:
      The table adapter for the Iceberg table.
      See Also:
    • loadTable

      public IcebergTableAdapter loadTable(@NotNull @NotNull LoadTableOptions options)
      Load an Iceberg table from the catalog with options.
      Parameters:
      options - The load table options
      Returns:
      The table adapter for the Iceberg table.
    • catalog

      public org.apache.iceberg.catalog.Catalog catalog()
      Returns the underlying Iceberg catalog used by this adapter.
    • createTable

      public IcebergTableAdapter createTable(@NotNull @NotNull String tableIdentifier, @NotNull @NotNull TableDefinition definition)
      Create a new Iceberg table in this catalog with the given tableIdentifier and definition. The resulting table's Schema will have fields with the same name and order as definition. Their types will be inferred via TypeInference.of(Type, TypeUtil.NextID) . The partitioning columns will be used as identity transforms for the PartitionSpec. Callers should take note of the documentation on Resolver.definition() when deciding to create an Iceberg Table with partitioning columns.
      Parameters:
      tableIdentifier - The identifier of the new table.
      definition - The TableDefinition of the new table.
      Returns:
      the resolver
      Throws:
      org.apache.iceberg.exceptions.AlreadyExistsException - if the table already exists
    • createTable

      public IcebergTableAdapter createTable(@NotNull @NotNull org.apache.iceberg.catalog.TableIdentifier tableIdentifier, @NotNull @NotNull TableDefinition definition)
      Create a new Iceberg table in this catalog with the given tableIdentifier and definition. The resulting table's Schema will have fields with the same name and order as definition. Their types will be inferred via TypeInference.of(Type, TypeUtil.NextID) . The partitioning columns will be used as identity transforms for the PartitionSpec. Callers should take note of the documentation on Resolver.definition() when deciding to create an Iceberg Table with partitioning columns.
      Parameters:
      tableIdentifier - The identifier of the new table.
      definition - The TableDefinition of the new table.
      Returns:
      the resolver
      Throws:
      org.apache.iceberg.exceptions.AlreadyExistsException - if the table already exists