Replies: 1 comment
-
My deviceId are 'welder01' and 'welder02', seems an event input for welder01 clears the cached average value of welder02. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
As the documents said, the normal use case for scan table is to use it by join. I have a rule to calculate the average current of welders and store it in a scan table, and then join it with the original stream so that it outputs both the original current and the average current. Everything works find when there is only one welder instance, however, it sometimes output nothing for the average current when working with two welder instances inputs data.
Here is the table:
CREATE TABLE scan_tbl_avg_current (deviceId string, avg_current float) WITH (DATASOURCE="avg_current", FORMAT="JSON", TYPE="mqtt", KEY="deviceId", RETAIN_SIZE="1000");"
Here is the rule:
SELECT *, scan_tbl_avg_current.avg_current as avg_current FROM welders LEFT JOIN scan_tbl_avg_current on welders.deviceId = scan_tbl_avg_current.deviceId
my question on the how the 'join' keyword behaves , does it empty the whole cache after an input triggers? Does the RETAIN_SIZE relevant to the problem?
Beta Was this translation helpful? Give feedback.
All reactions