Help needed - Attempting to join wildcard table with wildcard stream
Have an mqtt stream setup to listen for a wildcard topic +/+/Temp, and also created a table to hold the state of the topic as +/+/Setpoint. Attempting to do a join and create a rule that checks if Temp > Setpoint.
The SQL we have attempted: SELECT Temp.DEVICE as stDevice, SPTTABLE.DEVICE as spDevice from Temp LEFT JOIN SPTTable ON Temp.DEVICE = SPTTable.DEVICE GROUP BY TUMBLINGWINDOW(ss, 60)
It seems to be joining all of the Temps with the last seen Setpoint. Both stream and table are defined the same as far as structure goes, and we are attempting to join on the DEVICE which is a string. Is this possible to do with streams or tables?
It seems to be joining all of the Temps with the last seen Setpoint
By default, the table will retain the last seen event. How many Setpoint events do you want to join? You can specify the RETAIN_SIZE propety to specify how many events to retain in the table, example as below:
CREATE TABLE demoTable (
device STRING,
ts BIGINT
) WITH (DATASOURCE="demoTable", RETAIN_SIZE="3");
Close as inactivity