CREATE ICEBERG NAMESPACE
Iceberg namespaces are supported only in Eon Mode.
Creates an Iceberg namespace that maps OpenText™ Analytics Database namespace to an external Apache Iceberg catalog. An Iceberg namespace provides the entry point for accessing Iceberg metadata and data from the database and enables querying Iceberg tables without needing to define separate external tables for each Iceberg table.
OpenText™ Analytics Database integrates with Apache Iceberg at the namespace level, where each Iceberg catalog (that can be of type filesystem, AWS Glue, Hive Metastore, or REST) is represented as a database namespace. Iceberg objects (for example, tables) are resolved dynamically through the external catalog at query time. Once created, the namespace can be used as the top‑level qualifier in fully qualified object references when querying Iceberg tables.
Syntax
CREATE ICEBERG NAMESPACE namespace_name
[WITH [CATALOG='type of catalog' LOCATION='path/to/storage_uri']]
Arguments
| Argument | Description |
|---|---|
NAMESPACE_NAME |
The name of the namespace that represents the Iceberg catalog. This namespace becomes the top‑level qualifier for Iceberg object access. |
CATALOG |
The type of the Iceberg metadata catalog. The supported catalog types are filesystem, glue, hive, and rest. |
LOCATION |
Path to the Iceberg warehouse that contains Iceberg metadata.
|
rest_auth |
The authentication method for the REST catalog which supports either bearerToken or OAuth2 authentication. Applicable only when CATALOG is rest. For more information about rest_auth, see CREATE EXTERNAL TABLE ICEBERG. |
Privileges
- Superuser privileges to create, alter or drop Iceberg namespaces in the database.
- Non‑superusers can query Iceberg data if they have appropriate access to the underlying storage.
Examples
Assume the following Iceberg directory structure:
/iceberg/warehouse/
├── prod_analytics/
| ├── click_events/
│ | ├── data/
│ │ │ ├── 00000-0.parquet
│ │ │ ├── 00001-0.parquet
│ │ │ └── 00002-0.parquet
| | |
| | └── metadata/
| | ├── v1.metadata.json
| | ├── v2.metadata.json
| | ├── v3.metadata.json
│ │ ├── snap-1001.avro
│ │ ├── snap-1002.avro
│ │ ├── manifest-list-1001.avro
│ │ ├── manifest-list-1002.avro
│ │ └── manifests/
│ │ ├── 8a1f.manifest.avro
│ │ ├── 91c3.manifest.avro
│ │ └── a77b.manifest.avro
| |
│ └── user_sessions/
│ ├── data/
│ │ ├── 00000-0.parquet
│ │ └── 00001-0.parquet
| |
│ └── metadata/
│ ├── v1.metadata.json
│ ├── v2.metadata.json
│ ├── manifest-list-2001.avro
│ └── manifests/
│ ├── 11aa.manifest.avro
│ └── 22bb.manifest.avro
|
├── prod_billing/
│ └── invoices/
│ ├── data/
│ │ ├── 00000-0.parquet
│ │ └── 00001-0.parquet
| |
│ └── metadata/
│ ├── v1.metadata.json
│ ├── manifest-list-3001.avro
│ └── manifests/
| └── ff10.manifest.avro
│
└── dev_sandbox/
└── test_table/
├── data/
│ └── 00000-0.parquet
|
└── metadata/
├── v1.metadata.json
├── manifest-list-1.avro
└── manifests/
└── abcd.manifest.avro
Create an Iceberg namespace named iceberg_namespace_fs with filesystem catalog that points to a filesystem warehouse.
=> CREATE ICEBERG NAMESPACE iceberg_namespace_fs
WITH CATALOG='filesystem' LOCATION='/iceberg/warehouse';
Create an Iceberg namespace named iceberg_namespace_glue with AWS Glue catalog that points to a Glue warehouse.
=> CREATE ICEBERG NAMESPACE iceberg_namespace_glue
WITH CATALOG='glue' LOCATION='s3://my-glue-warehouse/';
Query namespaces to verify that the new namespaces are created.
=> SELECT name from v_catalog.iceberg_namespaces;
name
-----------------------
default_namespace
iceberg_namespace_glue
(2 rows)
Retrieve the count of all records from the iceberg_namespace_glue namespace.
=> SELECT COUNT(*) FROM iceberg_namespace_glue.testdb.compare;
COUNT
-------
10
(1 row)
Create an Iceberg namespace named iceberg_namespace_hms with Hive Metastore catalog that points to a Hive warehouse.
=> CREATE ICEBERG NAMESPACE iceberg_namespace_hms
WITH CATALOG='hms' LOCATION='thrift://my.hms.host.com:9083';
Create an Iceberg namespace named iceberg_namespace_rest with REST catalog that points to a REST warehouse.
=> CREATE ICEBERG NAMESPACE iceberg_namespace_rest
WITH CATALOG='rest' LOCATION='https://myhost:19120/iceberg/v1/main/namespaces' REST_AUTH='{"bearerToken": "eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICIzWFRweHB"}';