Hi,  macia

> 在 2021年2月9日,10:40,macia kk <pre...@gmail.com> 写道:
> 
> SELECT *FROM
>    (
>        SELECT  tt.*
>        FROM
>            input_tabe_01 tt
>            FULL OUTER JOIN input_tabe_02 mt
>            ON (mt.transaction_sn = tt.reference_id)
>            and tt.create_time >= mt.create_time + INTERVAL '5' MINUTES
>            and tt.create_time <= mt.create_time - INTERVAL '5' MINUTES
>        WHERE COALESCE(tt.create_time, mt.create_time) is not NULL
>    ) lt
>    LEFT JOIN exchange_rate ex
>    /*+ 
> OPTIONS('streaming-source.enable'='true','streaming-source.partition.include'
> = 'all') */
>    FOR SYSTEM_TIME AS OF lt.event_time ex ON DATE_FORMAT
> (lt.event_time, 'yyyy-MM-dd') = cast(ex.date_id as String)


你说的异常我本地没有复现,异常栈能直接贴下吗?

另外看你写的是lt.event_time, 
这个sql的是要做版本表的维表关联吗?目前Hive还不支持指定版本表的,只支持最新分区作为维表或者整个hive表作为维表,
两种维表的option你可参考下[1]

祝好,
Leonard
[1] 
https://ci.apache.org/projects/flink/flink-docs-master/dev/table/connectors/hive/hive_read_write.html#temporal-join-the-latest-table



回复