Flink SQL的N way join
生活随笔
收集整理的這篇文章主要介紹了
Flink SQL的N way join
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
概述
本文用來詳解[1]
?
SQL結構
[1]中的整個md文件中的sql其實是想表達上圖的這個邏輯
這里的SQL寫的時候需要注意一個細節:
| ? | connector設置 |
| 維度表 | 'connector' = 'upsert-kafka' |
| 事實表 | 'connector' = 'kafka'? ? |
所謂的N way Join就是在SQL里面一個fact table和多個維度表進行join,如下:
SELECT t.actual_departure_date, p.first_name,p.last_name,b.channel, os.city AS origin_station,ds.city AS destination_station FROM train_activities t LEFT JOIN booking_channels FOR SYSTEM_TIME AS OF t.actual_departure_date AS b ON t.booking_channel_key = b.booking_channel_key LEFT JOIN passengers FOR SYSTEM_TIME AS OF t.actual_departure_date AS p ON t.passenger_key = p.passenger_key LEFT JOIN stations FOR SYSTEM_TIME AS OF t.actual_departure_date AS os ON t.origin_station_key = os.station_key LEFT JOIN stations FOR SYSTEM_TIME AS OF t.actual_departure_date AS ds ON t.destination_station_key = ds.station_key;?
這個實驗對硬件資源有些要求,
如果資源不夠的話,提交一段時間后,web UI會顯示任務會超時
?
Reference:
[1]https://github.com/ververica/flink-sql-cookbook/blob/master/joins/05/05_star_schema.md
總結
以上是生活随笔為你收集整理的Flink SQL的N way join的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: microsoft edge浏览器好吗(
- 下一篇: linux cmake编译源码,linu