如果你的tEnv用的是TableEnvironment,而不是StreamTableEnvironment的话,两个insert会公用前面的source,也就是会只读取a表一次,然后分别给下游c和d用。

[email protected] <[email protected]> 于2020年5月28日周四 下午3:14写道:

> Hi,all:
> 当前使用版本flink 1.10.0,使用blink planner,假如有如下代码:
>
> tEnv.createTemporaryView("b", tEnv.sqlQuery("select * from a"));
> tEnv.sqlUpdate("insert into c select * from b where b.con1 = '1'");
> tEnv.sqlUpdate("insert into d select * from b where b.con1 = '2'");
>
> 其中a是kafka表,connector属性为:
> 'connector.properties.group.id' = 'testGroup',
> 'connector.startup-mode' = 'group-offsets'
>
>            疑问是该应用运行时c、d消费a表,a表group 'testGroup'
> offset的提交会不会受到影响,还是a表中同一条记录会流向2个不同的分支?
>


-- 

Best,
Benchao Li

回复