When and how latest state of source data is updated in a rule ? #3298
Replies: 1 comment 1 reply
-
@younes199511 When using SQL, analytic function will be planned to run for each input. However, in graph API, there is no planning. Thus, you'll need to put it in appropriate position and refer to the result with alias value. Like source -> latest(var) as lvar -> other operators, refer to the latest value by lvar. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
I've recently created a rule utilizing the latest analytic function within ekuiper, and I've encountered some behaviors that I'm struggling to comprehend. Specifically, I'm seeking clarity on the process and timing of how the latest state of the source data is updated within a rule.
I have the following graph rule:
In this rule, I am retrieving data from the Edgex source, where multiple auto events with different polling periods are present. I am utilizing filters to manage the rule execution, with the intention of having the rule (compFunction node) executed only when the source input has readings for var1 or var2, and to ignore other events. Subsequently, I aim to publish the result with the sink only when the compFunction node is calculated with not nil data for latest(va1) and latest(var2)
The observed behavior is as follows:
If var1 is published first:
In this scenario, I am puzzled as to why I do not have the latestVar1 in the second execution, even though comp_result is correct and rule passes the outputFilter.
If var2 is published first:
In this scenario, I am puzzled as to why I do not receive any output in the second execution, even though I have already published data for both variables.
I have attempted other options such as filtering the latest non-nil data in the input filter or adding a switch node instead of an output filter, but I consistently encounter the issue of my rule never publishing a result or exhibiting the same behavior as described above.
If anyone could provide insights or share their experiences, it would be incredibly helpful. Thank you all in advance for your assistance.
Beta Was this translation helpful? Give feedback.
All reactions