ByteHouse Cloud Data Warehouse VersionUser guideData modelingExternal CatalogIceberg Catalog
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.
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.
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).
endpoint: You can log in to the TOS Console and navigate to Bucket List > Bucket Name > Overview > URL Full Domain to view the required endpoint. For the recommended endpoint list, see the S3 Endpoint column in Region and URL Full Domain (Endpoint).
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.
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.
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).
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.
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).
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:
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;
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:
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
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.
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.