KSQL:无效的连接条件:当连接超过 2 个表时,不支持将外键表-表连接作为 n 路的一部分
我有 3 个主题,其中包含 KAFKA_INT 关键
客户、订单、订单详细信息
当我仅连接 2 个表时
select * from orders o join customer c on o.custid = c.custid emit changes; -- OK
select od.id, od.orderid from orderdetails od join orders o on od.orderid = o.orderid emit changes; -- OK
-- NOT OK
select * from orderdetails od
join order o on od.orderid = o.orderid
join customer c on o.custid = c.custid
emit changes limit 5;
-- Error
Invalid join condition: foreign-key table-table joins are not supported as part of n-way joins. Got o.custid = c.custid.
但是,我找不到任何文档如何连接多个表以及它的限制是什么。
我正在使用 Confluence KAFKA HELM 版本 7.0
I have 3 topics with KAFKA_INT key
customer,orders,orderdetails
When i do joining 2 tables only
select * from orders o join customer c on o.custid = c.custid emit changes; -- OK
select od.id, od.orderid from orderdetails od join orders o on od.orderid = o.orderid emit changes; -- OK
-- NOT OK
select * from orderdetails od
join order o on od.orderid = o.orderid
join customer c on o.custid = c.custid
emit changes limit 5;
-- Error
Invalid join condition: foreign-key table-table joins are not supported as part of n-way joins. Got o.custid = c.custid.
However, I couldn't find any documentation how can multiple tables join work and what is the limitation of it.
I am using Confluent KAFKA HELM version 7.0
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
正如错误消息所述,ksqldb 不支持表到表多重联接(n 路联接)。为了进行该连接,您可能需要创建一个中间支持表。像这样:
现在您可以使用此表来执行查询:
Table to table multi joins (n-way joins) are not supported in ksqldb as the error message says. In order to make that joins probably you will need to make an intermediate support table. Something like this:
Now you can use this table to perform your query: