簡體   English   中英

KSQL Steam-table Left join 部分(和靜默)無法填充值

[英]KSQL Steam-table Left join partially (and silently) fails to populate values

我正在加入一個帶有桌子的流。 連接的結果只是部分成功。 一些值被准確填充,而其他值則為空。 我檢查以確保表和流中都存在這些值,並且用於連接的列是兩者的鍵。

我正在使用 confluent 加載正在使用 jdbc 從 MSSQL 中的表中讀取的主題。

然后我使用KSQL從相應的主題創建流和表,數據都是JSON格式。

表中缺失數據的時間戳早於流的時間戳。

create stream casecode_contract_stream as select ct.projectid, ct.casecode, cs.isTrue from contract_stream cs left join casecode_table ct on cs.projectid = ct.projectid;    

select * from casecode_contract_stream limit 1;
1532034321292 | 706083 | null | null | true

ksql> select * from casecode_contract_stream where casecode is not null limit 1;
1532034321292 | 705147 | 705147 | data1 | true

select * from casecode_table where projectid = 705147;
1532033878462 | 705147 | 705147 | data1 

select * from casecode_table where projectid = 706083;
1532033878463 | 706083 | 706083 | data2 

select * from contract_stream where projectid = 705147;
1532034321292 | 705147 | 705147 | true

select * from contract_stream where projectid = 706083;
1532034321292 | 706083 | 706083 | true

有什么建議?

結果取決於(非確定性)處理順序。 這是一個已知問題,正在努力使處理順序更具確定性。

可能會發生在將記錄添加到表端之前處理來自流端的記錄的情況。 對於這種情況,當您指定左連接時,流記錄將使用 NULL 連接。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM