Skip to main content
The Apache Iceberg Kafka Connect Sink connector is a Kafka Connect connector that writes data from Kafka topics to Apache Iceberg tables.
This connector is available as a built-in connector on StreamNative Cloud.

Prerequisites

  • Setup the Iceberg Catalog
  • Create the Iceberg connector control topic, which cannot be used by other connectors.

Quick Start

  1. Setup the kcctl client: doc
  2. Set up the Iceberg Catalog, we can use the below yaml file to create a local iceberg catalog in k8s:
  3. Initialize the Iceberg table:
  4. Create a JSON file like the following:
  5. Run the following command to create the connector:

Quick Start 2 - Write to AWS S3 Table

This is a real example which sink data to AWS S3 Iceberg table, below are the steps.
  1. Create an AWS S3 table bucket, this is a new bucket type, A regular S3 bucket won’t work for S3 Tables, here we use kc-test-iceberg-table as an example.
  2. Create a new database in the table bucket, you can go to the AWS Lake Formation console, and then go to the Data Catalog/Databases section to create it, here we use my_s3_namespace as an example.
  3. Create an AWS IAM user and attach the following policy to it, replace eu-north-1, account-id, kc-test-iceberg-table and my_s3_namespace with your real region, account-id, table-bucket and database respectively.:
  4. Create an access key for the IAM user, you will need the Access Key ID and Secret Access Key later.
  5. In the Lake Formation console, grant the user database permissions (Create table, Describe) on [account-id]:s3tablescatalog/kc-test-iceberg-table/my_s3_namespace, and table permissions (Super on ALL_TABLES or at least the table you’ll write).
  6. Create a JSON file like the following, replace the fields such as region, account-id, table_bucket, access_key_id and secret_access_key with your real values:
  7. Run the following command to create the connector:
  8. Produce some test data to the events topic, you can use the following command to produce some test data:
  9. Wait until the data is written to the Iceberg table, you can check the logs of the connector to see something like below:
  10. Check the Iceberg table in the AWS Athena console, you should see the events table in the my_s3_namespace database, and you can run a query like below to see the data:

Limitations

  • Each Iceberg sink connector must have its own control topic.

Configuration

The following Required properties are used to configure the connector. The following Advanced properties are used to configure the connector. For more information about the properties, see the official documentation.