lookup join用的维表需要从两张mysql表做关联后得到,因此创建了一个视图。但发现flink sql不支持lookup join关联视图,会抛
Temporal Table Join requires primary key in versioned table, but no primary key 
can be found. 


请问这种情况要怎么解决?


CREATE VIEW query_mer_view (mer_cust_id, update_time) AS
SELECT a.mer_cust_id, k.update_time
FROM ka_mer_info k INNER JOIN adp_mer_user_info a on k.mer_cust_id = 
a.mer_cust_id
where k.mer_cust_id <> '';


SELECT
            DATE_FORMAT(c.create_time, 'yyyy-MM-dd') AS payment_date,
            c.mer_cust_id,


            c.trans_amt,
            CASE c.trans_stat WHEN 'S' THEN c.trans_amt ELSE 0 END as succ_amt ,


            1 as trans_cnt,
            CASE c.trans_stat WHEN 'S' THEN 1 ELSE 0  END as succ_cnt ,
            CASE c.trans_stat WHEN 'F' THEN 1 ELSE 0  END as fail_cnt


        FROM charge_log as c
                 LEFT JOIN query_mer_view FOR SYSTEM_TIME AS OF c.proc_time AS q
                     ON c.mer_cust_id = q.mer_cust_id;

回复