You need to enable JavaScript to run this app.
ByteHouse Cloud Data Warehouse Version

ByteHouse Cloud Data Warehouse Version

Copy page
Download PDF
External Catalog
Iceberg Catalog
Copy page
Download PDF
Iceberg Catalog

ByteHouse Cloud Data Warehouse version supports integrating Iceberg Catalog. You do not need to manually create external databases or tables; you can directly search data in Iceberg via Iceberg Catalog. This article introduces how to create and use Iceberg Catalog.

Background information

Iceberg supports multiple metadata storage forms, including the following:

  • Self-contained form stored in storage media (such as S3-compatible object storage service)
  • Open-source Hive metastore
  • BytePlus AI Data Lake Service LAS

ByteHouse Iceberg external Catalog currently supports Iceberg metadata storage forms including S3-compatible object storage service and LAS. The creation method for Iceberg external Catalog varies depending on the metadata storage service used. You can select the corresponding creation method according to the actual service used.

Prerequisites

Please follow the metadata storage form used by your Iceberg cluster to obtain the following privileges and connection information.

Metadata storage format

Required permissions and connection information

S3-compatible object storage service

  • Obtain permission to access the S3-compatible object storage service used by Iceberg.
  • Connection address of Iceberg's data warehouse.
  • Access Key ID (AK) / Secret Access Key (SK) with permission to access S3-compatible object storage service. If you are using BytePlus Object Storage Service (TOS), see Access Key (key) management for how to obtain it.
  • Endpoint of S3-compatible object storage service. If you are using BytePlus Object Storage Service (TOS), see Region and domain name (Endpoint) for the S3 Endpoint column.

LAS

  • LAS Catalog access permissions, as well as database and table-level read/write permissions. For configuration details, see LAS access control.
  • Connection information:
    • Endpoint of the TOS service used by LAS, Access Key ID (AK) / Secret Access Key (SK).
    • The region of the physical data center for the TOS storage service used by LAS. For the recommended region list, see Region and URL Full Domain.
    • LAS access key AK/SK. See Access Key (Key) Management for how to obtain it.
    • LAS Catalog name.
    • The metadata storage service address for LAS. For the address corresponding to the recommended region, see URL.

Usage limitations
  • Manual addition of databases, tables, and related ALTER actions in Iceberg Catalog is not supported yet.
  • Iceberg Catalog requires ByteHouse engine version 2.3.2.0 or above. Before use, confirm that your engine version satisfies this requirement. You can view the current engine version on the ByteHouse Console Tenant management > Basic information page. If your engine version does not meet the requirement, submit a ticket and contact the ByteHouse team to upgrade the engine.

Create Iceberg Catalog

The parameter configuration for Iceberg varies depending on the metadata service used. This section introduces the creation method for Iceberg Catalog based on the type of metadata service.

S3

CREATE EXTERNAL CATALOG `{catalogName}`
PROPERTIES type='iceberg',
metastore_type='hadoop', 
warehouse='{warehouse}', 
endpoint='{endpoint}', 
ak_id='{accessKey}', 
ak_secret='{accessSecretKey}';

Param

Configuration description

Create Catalog description

Replace {catalogName} with your custom Catalog name.

Catalog param

  • type='iceberg': Set to iceberg.
  • metastore_type='hadoop': Set to hadoop.
  • warehouse: Replace {warehouse} with the top-level directory of the connection address of the Iceberg data warehouse, for example: s3://test-dev-hcf/iceberg. If you use BytePlus object storage service TOS, you also need to fill in according to this format.
  • endpoint: The connection address of the external data source. For example, if you use BytePlus object storage service TOS, you can log in to the TOS Console and navigate to Bucket List > Bucket Name > Overview > URL Full Domain to view the required endpoint. As shown in the figure below, the endpoint is tos-s3-cn-beijing.volces.com. For the recommended endpoint list, see the S3 Endpoint column in Region and URL Full Domain (Endpoint).

Image

  • ak_id/ak_secret: Key with S3 access privilege. If you use BytePlus object storage service TOS, see Access Key (Key) Management for how to obtain it.

LAS

CREATE EXTERNAL CATALOG `{catalogName}` 
PROPERTIES
type='iceberg',
metastore_type='lf',
endpoint='{endpoint}', 
ak_id='{accessKey}', 
ak_secret='{accessSecretKey}', 
lf_metastore_ak_id='{lasAccessKey}',
lf_metastore_ak_secret='{lasAccessSecretKey}',
lf_metastore_catalog='{lasCatalogName}',
lf_metastore_region='{lasEndpoint}',
lf_metastore_url = '{lasUri}';

Param

Configuration description

Create Catalog description

Replace {catalogName} with your custom Catalog name.

Catalog param

  • type='iceberg': Set to iceberg.
  • metastore_type='lf': Set to lf.
  • endpoint: The endpoint of the BytePlus object storage service (TOS) used by LAS. You can log in to the TOS Console and navigate to Bucket List > Bucket Name > Overview > URL Full Domain to view the required endpoint. As shown in the figure below, the endpoint is tos-s3-cn-beijing.volces.com. For the recommended endpoint list, see the S3 Endpoint column in Region and URL Full Domain (Endpoint).

Image

  • ak_id/ak_secret: Configure with a TOS key that has access privilege. See Access Key (Key) Management for how to obtain it.
  • lf_metastore_ak_id/lf_metastore_ak_secret: Configure with an LAS key that has access privilege. See Access Key (Key) Management for how to obtain it.
  • lf_metastore_catalog: Enter the name of the Catalog you want to connect to, which already exists in LAS, so that ByteHouse can locate the correct external data directory. You can log in to the LAS Console, and in the left navigation bar, click Database > Metadata management to view the Catalog Name.
  • lf_metastore_region: Configuration for the region where the physical data center of the TOS storage service used by LAS is located. For commonly used region names, see Region and URL Full Domain.
  • lf_metastore_url: Configuration for the metadata storage service address of LAS. Can be filled in as thrift://lakeformation.las.{REGION}. ivolces.com:48869. The addresses corresponding to commonly used regions are as follows:
    • cn-beijing:thrift://lakeformation.las.cn-beijing.ivolces.com:48869
    • cn-shanghai:thrift://lakeformation.las.cn-shanghai.ivolces.com:48869
    • cn-guangzhou:thrift://lakeformation.las.cn-guangzhou.ivolces.com:48869
    • ap-southeast-1:thrift://lakeformation.las.ap-southeast-1.ivolces.com:48869

Use Iceberg Catalog

Assume you have already created an external Catalog named iceberg_s3.

View Iceberg Catalog

View all Catalogs to list all created external Catalogs.

SHOW EXTERNAL CATALOGS;

View the schema information of a Catalog.

SHOW CREATE EXTERNAL CATALOG catalog_name;

Search tables in Iceberg Catalog

Users can directly access tables in Iceberg Catalog by using the three-part naming convention catalog_name.db_name.table_name, for example:

SELECT * FROM iceberg_s3.iceberg_db_name.iceberg_table_name;

ByteHouse native CnchMergeTree tables can also be accessed using the following SQL. Here, cnch (short for cloud-native-clickhouse) is used as the default Catalog name for ByteHouse CDW.

SELECT * FROM cnch.cnch_db_name.cnch_db_name;
-- Equivalent to SELECT * FROM cnch_db_name.cnch_db_name;

By using external Catalogs, you can directly join Iceberg external tables and ByteHouse CnchMergeTree tables.

SELECT * FROM iceberg_s3.iceberg_db.iceberg_table 
UNION ALL 
SELECT (1) FROM cnch.cnch_db.cnch_table;

List databases and tables in Iceberg Catalog

List database names in Iceberg Catalog.

SHOW DATABASES FROM catalog_name;

List table names in a database.

SHOW TABLES FROM catalog_name.database_name;

Obtain the create statement of a table.

SHOW CREATE TABLE catalog_name.database_name.table_name;

Switch Catalog

You can use the following SQL to change the default Catalog. After execution, subsequent queries will use the databases and tables under this Catalog by default:

SWITCH CATALOG catalog_name;

After running the query statement again, ByteHouse will read data from the specified database and table under the Iceberg Catalog.

SELECT * FROM iceberg_db.iceberg_table;

To switch back to the ByteHouse default Catalog, you can use any of the following commands:

# 方式 1
SWITCH CATALOG default;

# 方式 2
SWITCH CATALOG cnch;

You can also use the following command to directly switch the default database to the specified database under the Iceberg Catalog:

USE iceberg_s3.iceberg_db;

To switch back to ByteHouse internal tables, use the following command:

USE cnch.cnch_database_name;

Query the currently used Catalog

You can query the current Catalog by using the currentCatalog() function.

SELECT currentCatalog();

Query Iceberg Catalog metadata

You can use the following statements to query metadata of databases, tables, and partitions in the Iceberg Catalog, including database name, storage path, attributes, and more.

  • Query metadata of database tables in the Iceberg Catalog

    SELECT * FROM catalog_name.database_name.table_name$metadata$properties
    
  • Query metadata of table partitions in the Iceberg Catalog

    SELECT * FROM {catalog_name.}database_name.table_name$metadata$partitions
    

Delete Iceberg Catalog

You can use the following command to delete the Iceberg Catalog.

DROP EXTERNAL CATALOG [IF EXISTS] catalog_name;

Use Iceberg Catalog via ByteHouse Cloud Data Warehouse Console

ByteHouse Cloud Data Warehouse also supports creating and using Iceberg Catalog via the ByteHouse Cloud Data Warehouse Console. For details, see Manage external catalog.

Use Iceberg external tables

In addition to accessing Iceberg data via Iceberg Catalog, ByteHouse also supports querying and writing Iceberg data via external tables. For details, see Iceberg external table.

Last updated: 2026.03.31 16:24:06