Help Center/ AI DataLake/ devg/ Iceberg Development Guide/ Iceberg on Flink/ Querying and Writing to Iceberg
Updated on 2026-11-06 GMT+08:00
Querying and Writing to Iceberg
Important Notes
- Checkpointing is required for streaming writes to Iceberg.
- Streaming reads are not supported for Iceberg tables that use UPSERT writes.
Code Examples
Example 1: Append data without a primary key to an Iceberg table.
CREATE CATALOG lf_iceberg_catalog
WITH
(
'type' = 'iceberg',
'catalog-type' = 'lakeformation'
);
CREATE TABLE IF NOT EXISTS lf_iceberg_catalog.iceberg_db.iceberg_table (
id BIGINT,
data STRING
)WITH('format-version' = '2');
CREATE TABLE kafka_source (id BIGINT, data STRING)
WITH
(
'connector' = 'kafka',
'topic' = 'user-events',
'properties.bootstrap.servers' = '127.0.0.1:9092',
'properties.group.id' = 'flink-consumer-group',
'scan.startup.mode' = 'latest-offset',
'format' = 'json'
);
INSERT INTO
lf_iceberg_catalog.iceberg_db.iceberg_table
SELECT
*
FROM
kafka_source Example 2: Read an Iceberg table in streaming mode.
CREATE CATALOG lf_iceberg_catalog
WITH
(
'type' = 'iceberg',
'catalog-type' = 'lakeformation'
);
CREATE TABLE sink (id BIGINT, data STRING)
WITH
('connector' = 'print');
INSERT INTO
sink
SELECT
*
FROM
lf_iceberg_catalog.iceberg_db.iceberg_table /*+ OPTIONS('streaming'='true', 'monitor-interval'='60s') */; Parent topic: Iceberg on Flink
What is your overall rating for this page?
0
1
2
3
4
5
6
7
8
9
10
Very dissatisfiedVery satisfied
Thank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
The system is busy. Please try again later.
For any further questions, feel free to contact us through the chatbot.
Chatbot