Stream :
describe ammas;
Field | Type
-------------------------------------
ROWTIME | BIGINT (system)
ROWKEY | VARCHAR(STRING) (system)
ID | INTEGER
-------------------------------------
For runtime statistics and query details run: DESCRIBE EXTENDED <Stream,Table>;
Table-01 :
ksql> show tables;
Table Name | Kafka Topic | Format | Windowed
-------------------------------------------------
ANNAT | anna | DELIMITED | false
APPAT | appa | DELIMITED | false
-------------------------------------------------
Trying to Join stream vs. table-01 is working as expected.
Create stream finalstream as select a.id
from ammas
a left join appat b
on a.id = b.id
where b.id
is null
.
But when I tried to join more than one table with stream based on the following query:
ksql> SELECT * FROM ammas cd LEFT JOIN appat ab ON ab.id = cd.id LEFT JOIN annat aa ON aa.id =cd.id;
ServerError:io.confluent.ksql.parser.exception.ParseFailedException
Caused by: null
What is going wrong? Thanks.
KSQL currently (v5.3) only supports a single join operation per statement. If you want to perform multiple joins you have to "daisy-chain" them in multiple statements, e.g.
CREATE STREAM out1 AS
SELECT * FROM ammas cd
LEFT JOIN appat ab
ON ab.id = cd.id
CREATE STREAM out_final AS
SELECT * FROM out1 o
LEFT JOIN annat aa ON o.id =cd.id;
来源:https://stackoverflow.com/questions/51459018/is-it-possible-to-use-multiple-left-join-in-confluent-ksql-query-tried-to-join