在ksql中是否可以连接两个以上的流/表?
例子:
我有三条溪流:
CREATE STREAM StreamA (id BIGINT, message VARCHAR) WITH
(KAFKA_TOPIC='TopicA', VALUE_FORMAT='DELIMITED');
CREATE STREAM StreamB (id BIGINT, aid BIGINT, message VARCHAR) WITH .
(KAFKA_TOPIC='TopicB', VALUE_FORMAT='DELIMITED');
CREATE STREAM StreamC (id BIGINT, bid BIGINT, message VARCHAR) WITH
(KAFKA_TOPIC='TopicC', VALUE_FORMAT='DELIMITED');
我尝试通过连接这三个流来创建另一个流:
CREATE STREAM ABCStream AS SELECT * FROM StreamA a JOIN
StreamB b ON b.aid = a.id JOIN StreamC c WITHIN 1 HOURS ON
c.bid = b.id;
我得到以下例外:
mismatched input 'JOIN' expecting ';'
Caused by: org.antlr.v4.runtime.InputMismatchException
1条答案
按热度按时间vwhgwdsa1#
不,在ksql版本5.0之前,每个查询只能连接两个。你需要把你的查询串起来,类似这样:
中间流:
多连接流