已解决,问题在于 Kafka 不是直接 join 维表,而是先和 UDTF join,之后整体才与维表 Join。
所以之前起别名的位置有误。导致找不到字段、改造如下:
先前写法:
INSERT INTO sinktable select
// 省略字段
from KafkaTable,LATERAL TABLE(RequestBodyColumnToRow(message,
'uid,game_id(BIGINT),platform'
)) *as k* LEFT JOIN DimTable FOR SYSTEM_TIME AS OF k.record_time as d
ON k.game_id = d.game_id and k.platform = d.platform;
改造写法:
INSERT INTO sinktable select
// 省略字段
from (
select *
from KafkaTable,LATERAL TABLE(RequestBodyColumnToRow(message,
'uid,game_id(BIGINT),platform'
))) as k JOIN DimTable FOR SYSTEM_TIME AS OF k.procTime as d
ON k.game_id = d.game_id and k.platform = d.platform;
--
Sent from:
http://apache-flink.147419.n8.nabble.com/