我在 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',
.... );
是的,这是可能的。详细信息在文档中有描述。