Hi Team, I am working on Flink SQL queries along w...
# troubleshooting
s
Hi Team, I am working on Flink SQL queries along with AWS Kinesis Data Stream running in Apache Flink 1.15, Apache Zeppelin 0.10. I am trying to perform LEFT JOIN in it but getting "TableException: Table sink 'hive.default.alarm_transitions_table' doesn't support consuming update and delete changes" when running this query -
%flink.ssql(type=update)
INSERT INTO alarm_transitions_table
SELECT
i.*,
m.*,
CASE
WHEN i.power1 = true AND i.set_point > 0 AND i.temperature <> 0 AND i.temperature < i.set_point THEN 'heating'
WHEN i.power1 = true AND i.set_point > 0 AND i.temperature <> 0 AND i.temperature >= i.set_point AND ABS(i.temperature - i.set_point) <= 50 THEN 'reached'
WHEN i.power1 = true AND i.set_point > 0 AND i.temperature <> 0 AND i.temperature > i.set_point + 50 THEN 'deviated'
ELSE NULL
END AS grill_state
FROM
``rt-dev-wus2-glue-iotdatastream` i`
left JOIN
``rt-dev-wus2-glue-mobiledatastream` m`
ON i.device_id = m.id
But when referred online documents found out we can perform LEFT JOIN with Temporal Joins. And I modified my query to this -
%flink.ssql(type=update)
INSERT INTO alarm_transitions_table
SELECT
i.*,
m.*,
CASE
WHEN i.power1 = true AND i.set_point > 0 AND i.temperature <> 0 AND i.temperature < i.set_point THEN 'heating'
WHEN i.power1 = true AND i.set_point > 0 AND i.temperature <> 0 AND i.temperature >= i.set_point AND ABS(i.temperature - i.set_point) <= 50 THEN 'reached'
WHEN i.power1 = true AND i.set_point > 0 AND i.temperature <> 0 AND i.temperature > i.set_point + 50 THEN 'deviated'
ELSE NULL
END AS grill_state
FROM
``rt-dev-wus2-glue-iotdatastream` i` `LEFT JOIN
rt-dev-wus2-glue-mobiledatastream
FOR SYSTEM_TIME AS OF i.event_time AS m`
ON i.device_id = m.id;
For the updated query I am getting "Temporal table join currently only supports 'FOR SYSTEM_TIME AS OF' left table's time attribute field" Can someone please give me a solution to this and LMK how to perform Temporal Join in Apache Flink SQL along with AWS Kinesis Data Stream?