?????????????????????????????????????? ????????????????????????????tableFact????????????tableDimA??tableDimDetailB??tableDimDetailC????left join??????????????????userId??actPkId??bId??cType??create_time??????????????????????????????????actPkId????????
??????????????????????????bId??cType??create_time????????????????????????????????????join??SQL???????????????????? ???????????????? tableFact( userId String primary key, create_time ) tableDimA ( actPkId String primary key, targetUserId String, start_time datetime, end_time datetime ) tableDimDetailB ( actPkId String primary key, bId String ) tableDimDetailC ( actPkId String primary key, cType String ) ?????? A: fact.userlddimA.targetUserld B: fact.bId == dimB.bId C: fact.cType == dimA.cType D: fact.create time >= dimA.start time and fact.create time <= dimA.end time ??????????A??????????B??C??D????????????????B??C??D???????????????????????? ?????????????????? ?? (A B C)????A??B??C?????????????????????????? SELECT * FROM tableFact P LEFT JOIN tableDimA FOR SYSTEM_TIME AS OF P.proctime AS A ON P.userId = A.targetUserId LEFT JOIN tableDimDetailB FOR SYSTEM_TIME AS OF P.proctime AS B ON A.actPkId = B.actPkId AND P.bId=B.bId LEFT JOIN tableDimDetailC FOR SYSTEM_TIME AS OF P.proctime AS C ON A.actPkId = C.actPkId AND P.cType=B.cType; ?? (A B C D)????A??B??C D?????????????????????????????????????? SELECT * FROM tableFact P LEFT JOIN tableDimA FOR SYSTEM_TIME AS OF P.proctime AS A ON P.userId = A.targetUserId LEFT JOIN tableDimDetailB FOR SYSTEM_TIME AS OF P.proctime AS B ON A.actPkId = B.actPkId AND P.bId=B.bId LEFT JOIN tableDimDetailC FOR SYSTEM_TIME AS OF P.proctime AS C ON A.actPkId = C.actPkId AND P.cType=B.cType WHERE P.create_time BETWEEN A.start_time AND A.end_time; ???????????? ??????????????????Flink??????????????????????????????????????????????sql???????????????????????????????????????????????????? ???? 1227581...@qq.com