Dynamic Table Options in Confluent Cloud for Apache Flink

Confluent Cloud for Apache Flink®️ supports dynamic table options, or SQL hints, which enable you to specify or override table options dynamically.

Syntax

To use dynamic table options, employ the following Oracle-style SQL hint syntax:

table_path /*+ OPTIONS(key=val [, key=val]*) */

key:
    stringLiteral
val:
    stringLiteral

Description

Dynamic Table Options in Confluent Cloud for Apache Flink offer the following benefits:

  • Flexible configuration: Specify table options on a per-statement basis, providing more flexibility than static options as stored in the table definition.
  • Query-specific adjustments: Customize table behavior for individual queries without altering the permanent table definition.

Examples

Here are some examples of using dynamic table options in Confluent Cloud for Apache Flink:

  • Override scan startup mode for a table:

    SELECT id, name
    FROM table /*+ OPTIONS('scan.startup.mode'='earliest-offset') */;
    
  • Set options for multiple tables in a join:

    SELECT *
    FROM table1 /*+ OPTIONS('scan.startup.mode'='earliest-offset') */ t1
    JOIN table2 /*+ OPTIONS('scan.startup.mode'='earliest-offset') */ t2
    ON t1.id = t2.id;
    
  • Set the scan startup mode to use the latest offset:

    SELECT *
    FROM orders /*+ OPTIONS('scan.startup.mode'='latest-offset') */;