IcebergCatalogAdapter
IcebergCatalogAdapter
is a class used to interact with Iceberg catalogs.
Constructors
An IcebergCatalogAdapter
is constructed via IcebergTools.createAdapter
import io.deephaven.iceberg.util.*
adapter = IcebergTools.createAdapter(BuildCatalogOptions options)
adapter = IcebergTools.createAdapter(
String name,
Map<String, String> properties
)
adapter = IcebergTools.createAdapter(
String name,
Map<String, String> properties,
Map<String, String> hadoopConfig
)
adapter = IcebergTools.createAdapter(org.apache.iceberg.catalog.Catalog catalog)
Parameters
When constructing an IcebergCatalogAdapter
, the following parameters can be specified:
BuildCatalogOptions
: Options for building the catalog.name
: The name of the catalog.properties
: A map of properties for the catalog.hadoopConfig
: A map of Hadoop configuration properties.catalog
: An instance oforg.apache.iceberg.catalog.Catalog
to wrap.
Methods
catalog
: Returns the underlying Iceberg catalog used by the adapter.createTable
: Create a new table in the catalog with a giventableIdentifier
anddefinition
.listNamespaces
: List all namespaces in the catalog.listTables
: List all tables in a given namespace.loadTable
: Load a table from the catalog.namespaces
: List all namespaces in the catalog as a Deephaven table.tables
: List all tables in a given namespace as a Deephaven table.
Examples
The following example constructs an IcebergCatalogAdapter
using the Docker deployment defined in the Iceberg user guide.
import io.deephaven.iceberg.util.*
restAdapter = IcebergTools.createAdapter(
"minio-iceberg",
[
"type": "rest",
"uri": "http://rest:8181",
"client.region": "us-east-1",
"s3.access-key-id": "admin",
"s3.secret-access-key": "password",
"s3.endpoint": "http://minio:9000",
"io-impl": "org.apache.iceberg.aws.s3.S3FileIO"
]
)