Package io.deephaven.iceberg.util
Class IcebergCatalogAdapter
java.lang.Object
io.deephaven.iceberg.util.IcebergCatalogAdapter
-
Method Summary
Modifier and TypeMethodDescriptionorg.apache.iceberg.catalog.Catalog
catalog()
Returns the underlying Icebergcatalog
used by this adapter.createTable
(@NotNull String tableIdentifier, @NotNull TableDefinition definition) Create a new Iceberg table in this catalog with the giventableIdentifier
anddefinition
.createTable
(@NotNull org.apache.iceberg.catalog.TableIdentifier tableIdentifier, @NotNull TableDefinition definition) Create a new Iceberg table in this catalog with the giventableIdentifier
anddefinition
.List<org.apache.iceberg.catalog.Namespace>
List allnamespaces
in the catalog.List<org.apache.iceberg.catalog.Namespace>
listNamespaces
(@NotNull org.apache.iceberg.catalog.Namespace namespace) List allnamespaces
in a given namespace.List<org.apache.iceberg.catalog.TableIdentifier>
listTables
(@NotNull org.apache.iceberg.catalog.Namespace namespace) List all Icebergtables
in a given namespace.loadTable
(@NotNull LoadTableOptions options) Load an Iceberg table from the catalog withoptions
.loadTable
(@NotNull org.apache.iceberg.catalog.TableIdentifier tableIdentifier) Load an Iceberg table from the catalog.Load an Iceberg table from the catalog.List allnamespaces
in the catalog as a Deephaventable
.namespaces
(@NotNull String... namespace) List allnamespaces
in a given namespace as a Deephaventable
.namespaces
(@NotNull org.apache.iceberg.catalog.Namespace namespace) List allnamespaces
in a given namespace as a Deephaventable
.tables
(@NotNull org.apache.iceberg.catalog.Namespace namespace) List all Icebergtables
in a given namespace as a Deephaventable
.
-
Method Details
-
listNamespaces
List allnamespaces
in the catalog. This method is only supported if the catalog implementsSupportsNamespaces
for namespace discovery. SeeSupportsNamespaces.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 allnamespaces
in a given namespace. This method is only supported if the catalog implementsSupportsNamespaces
for namespace discovery. SeeSupportsNamespaces.listNamespaces(Namespace)
.- Parameters:
namespace
- The namespace to list namespaces in.- Returns:
- A list of all namespaces in the given namespace.
-
namespaces
List allnamespaces
in the catalog as a Deephaventable
. The resulting table will be static and contain the same information aslistNamespaces()
.- Returns:
- A
table
of all namespaces.
-
namespaces
List allnamespaces
in a given namespace as a Deephaventable
. The resulting table will be static and contain the same information aslistNamespaces(Namespace)
.- Returns:
- A
table
of all namespaces.
-
namespaces
List allnamespaces
in a given namespace as a Deephaventable
. The resulting table will be static and contain the same information aslistNamespaces(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 Icebergtables
in a given namespace.- Parameters:
namespace
- The namespace to list tables in.- Returns:
- A list of all tables in the given namespace.
-
tables
List all Icebergtables
in a given namespace as a Deephaventable
. The resulting table will be static and contain the same information aslistTables(Namespace)
.- Parameters:
namespace
- The namespace from which to gather the tables- Returns:
- A list of all tables in the given namespace.
-
tables
-
loadTable
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
Load an Iceberg table from the catalog withoptions
.- 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 Icebergcatalog
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 giventableIdentifier
anddefinition
. The resulting table'sSchema
will havefields
with the same name and order asdefinition
. Their types will be inferred viaTypeInference.of(Type, TypeUtil.NextID)
. Thepartitioning columns
will be used asidentity transforms
for thePartitionSpec
. Callers should take note of the documentation onResolver.definition()
when deciding to create an Iceberg Table with partitioning columns.- Parameters:
tableIdentifier
- The identifier of the new table.definition
- TheTableDefinition
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 giventableIdentifier
anddefinition
. The resulting table'sSchema
will havefields
with the same name and order asdefinition
. Their types will be inferred viaTypeInference.of(Type, TypeUtil.NextID)
. Thepartitioning columns
will be used asidentity transforms
for thePartitionSpec
. Callers should take note of the documentation onResolver.definition()
when deciding to create an Iceberg Table with partitioning columns.- Parameters:
tableIdentifier
- The identifier of the new table.definition
- TheTableDefinition
of the new table.- Returns:
- the resolver
- Throws:
org.apache.iceberg.exceptions.AlreadyExistsException
- if the table already exists
-