使用flink-sql,如何创建一个使用通配符/正则表达式从多个主题读取的表

问题描述 投票:0回答:1

我在 flink-sql 应用程序中创建了 2 个具有完全相同结构的表..可以说

CREATE TABLE t1_g1
(
    `id`    INT,
    `name`    STRING
)
    WITH ( 'connector' = 'kafka',
        'topic' = 't1.g1',
        'properties.auto.offset.reset' = 'earliest',
        'scan.startup.mode' = 'earliest-offset',
....       );

CREATE TABLE t1_g2
(
    `id`    INT,
    `name`    STRING
)
    WITH ( 'connector' = 'kafka',
        'topic' = 't1.g2',
        'properties.auto.offset.reset' = 'earliest',
        'scan.startup.mode' = 'earliest-offset',
....       );

问题:flink-sql 是否可能或支持,如果我可以创建另一个表,使用一些通配符(如 ..)从 t1.g1 和 t1.g2 主题读取数据。

CREATE TABLE t_all
(
    `id`    INT,
    `name`    STRING
)
    WITH ( 'connector' = 'kafka',
        'topic' = 't1.*',
        'properties.auto.offset.reset' = 'earliest',
        'scan.startup.mode' = 'earliest-offset',
....       );
apache-kafka-connect flink-sql
1个回答
0
投票

是的,这是可能的。详细信息在文档中有描述。

© www.soinside.com 2019 - 2024. All rights reserved.