Creates a new Iceberg REST Catalog client.
Configuration options for the catalog client
Creates a new namespace in the catalog.
Namespace identifier to create
Optionalmetadata: NamespaceMetadataOptional metadata properties for the namespace
Creates a namespace if it does not exist.
If the namespace already exists, does nothing.
Namespace identifier to create
Optionalmetadata: NamespaceMetadataOptional metadata properties for the namespace
Creates a new table in the catalog.
Namespace to create the table in
Table creation request including name, schema, partition spec, etc.
Table metadata for the created table
const metadata = await catalog.createTable(
{ namespace: ['analytics'] },
{
name: 'events',
schema: {
type: 'struct',
fields: [
{ id: 1, name: 'id', type: 'long', required: true },
{ id: 2, name: 'timestamp', type: 'timestamp', required: true }
],
'schema-id': 0
},
'partition-spec': {
'spec-id': 0,
fields: [
{ source_id: 2, field_id: 1000, name: 'ts_day', transform: 'day' }
]
}
}
);
Creates a table if it does not exist.
If the table already exists, returns its metadata instead.
Namespace to create the table in
Table creation request including name, schema, partition spec, etc.
Table metadata for the created or existing table
Drops a namespace from the catalog.
The namespace must be empty (contain no tables) before it can be dropped.
Namespace identifier to drop
Drops a table from the catalog.
Table identifier to drop
Optionaloptions: DropTableRequestLists all namespaces in the catalog.
Optionalparent: NamespaceIdentifierOptional parent namespace to list children under
Array of namespace identifiers
Lists all tables in a namespace.
Namespace identifier to list tables from
Array of table identifiers
Loads metadata for a namespace.
Namespace identifier to load
Namespace metadata including properties
Loads metadata for a table.
Table identifier to load
Table metadata including schema, partition spec, location, etc.
Checks if a namespace exists in the catalog.
Namespace identifier to check
True if the namespace exists, false otherwise
Checks if a table exists in the catalog.
Table identifier to check
True if the table exists, false otherwise
Updates an existing table's metadata.
Can update the schema, partition spec, or properties of a table.
Table identifier to update
Update request with fields to modify
Updated table metadata
Client for interacting with an Apache Iceberg REST Catalog.
This class provides methods for managing namespaces and tables in an Iceberg catalog. It handles authentication, request formatting, and error handling automatically.
Example