flink cdc delete源表,目标表未删除,
如下:
INSERT INTO sink_table (
id,
device_id,
name,
device_type,
device_name,
gateway_serial_num,
points_model_id,
device_uniq_code,
etl_time)
SELECT
t1.id,
t1.device_id,
t2.device_type,
t2.device_name,
t2.gateway_serial_num,
t2.points_model_id,
CONCAT_WS(‘-‘, t1.station_id, t1.data_object_id),
CURRENT_TIMESTAMP
FROM table_a t1
LEFT JOIN
(
SELECT
id,
device_id,
name AS device_name,
cim_code AS device_type,
gateway_serial_num,
points_model_id
FROM table_b
UNION ALL
SELECT
id,
dg_id AS device_id,
name AS device_name,
type AS device_type,
gateway_serial_num,
CAST(NULL AS BIGINT) AS points_model_id
FROM table_c
) t2
ON t1.device_id = t2.id;
flink cdc delete主键删除源表,目标表未删除数据问题[阿里云实时计算 Flink版]
「点点赞赏,手留余香」
还没有人赞赏,快来当第一个赞赏的人吧!