Help Center/ AI DataLake/ Flink reference/ Enhanced Flink Features/ Flink on Iceberg Supporting Dimension Table Join
Updated on 2026-11-06 GMT+08:00

Flink on Iceberg Supporting Dimension Table Join

Scenario

Flink on Iceberg supports dimension table joins, allowing you to enrich real-time streaming data with static or slowly changing dimension data stored in Iceberg.

Notes and Constraints

  • By default, a lookup join loads all data in each concurrent. It is applicable only to dimension tables with a small amount of data.
  • Lookup join keys do not support complex data types, such as ARRAY, BINARY, DECIMAL, TIME, MAP, or VARIANT.
  • Cache refresh does not support incremental read. The entire table is scanned during each refresh.
  • The Iceberg dimension table supports only INSERT and UPDATE_AFTER messages.

Parameters

Key

Default Value

Value Range

Description

lookup.refresh.async

false

true/false

Specifies whether to refresh the cache asynchronously.

  • true: The background thread is used for refreshing, and the query is not blocked.
  • false: The query is blocked during synchronous refreshing.

lookup.refresh.interval

1h

Duration (for example, 24 hours)

Interval for refreshing all cached data.

lookup.cache.type

AUTO

AUTO / HEAP / ROCKSDB

Cache backend type.

  • AUTO: The backend is automatically selected based on the table size.
  • HEAP: Caffeine heap memory is used.
  • ROCKSDB: Disk-based.

lookup.cache.auto.bytes-threshold

64 MB

Flink MemorySize (for example, 32 MB)

In AUTO mode, if the table size exceeds this threshold, RocksDB is used. Otherwise, HEAP is used.

lookup.cache.max-table-size

512 MB

Flink MemorySize (for example, 256 MB)

If the size of the Iceberg dimension table exceeds this threshold, the table cannot be loaded.

lookup.rocksdb.path

${java.io.tmpdir}/iceberg-lookup-rocksdb

Valid local directory path.

Data storage path in RocksDB mode.

Usage

  1. Create a new Iceberg table, for example, iceberg_catalog.`default`.iceberg_table. The following is a code example:

    CREATE TABLE IF NOT EXISTS iceberg_catalog.`default`.iceberg_table (
      id BIGINT,
      data STRING
    ) PARTITIONED BY (id)
    WITH
      ('format-version' = '2');

  2. SQL example for dimension table join:

    CREATE TABLE datagen (id BIGINT)
    WITH
      (
        'connector' = 'datagen',
        'rows-per-second' = '1'
      );
    
    CREATE TABLE print
    WITH
      ('connector' = 'print') AS
    SELECT
      *
    FROM
      datagen AS o
      LEFT JOIN iceberg_catalog.`default`.iceberg_table /*+ OPTIONS('lookup.refresh.interval' = '24h') */ FOR SYSTEM_TIME AS OF PROCTIME () AS d ON o.id = d.id;