Set Operations
Batch Streaming
UNION
UNION and UNION ALL return the rows that are found in either table. UNION takes only distinct rows while UNION ALL does not remove duplicates from the result rows.
UNION和UNION ALL返回在任一表中找到的行。UNION只接受不同的行,而UNION ALL不会从结果行中删除重复项。
Flink SQL> create view t1(s) as values ('c'), ('a'), ('b'), ('b'), ('c');
Flink SQL> create view t2(s) as values ('d'), ('e'), ('a'), ('b'), ('b'

本文介绍了Flink SQL中的集合操作,包括UNION、INTERSECT、EXCEPT、IN和EXISTS。这些操作分别用于合并、查找交集、找出差异以及检查子查询是否存在指定值。在流式查询中,这些操作可能涉及无限增长的状态,需要配置状态生存时间(TTL)以控制状态大小,但这可能影响查询结果的正确性。
最低0.47元/天 解锁文章
3483

被折叠的 条评论
为什么被折叠?



