Skip to content
Advertisement

Esper: group by value in a named window and use this grouped value to determine the output id

I want to create a named window that takes the last 20 seconds of speed settings (1-10) and power outputs (float). Then I want to query this to get the average power per speed setting (from 1-10). For each speed setting I need to specify a specific output id. I tried to do this using an expression to convert the speed into this output id, but no matter which way I have done it, I get the error “expression requires stream name as a parameter”.

Can anyone point out the correct expression + how to use the expression in order to get my desired output?

If you can point out a better way to do it then that is great also. I am an esper newbie + don’t know Java and I am running these scripts on a server with a CEP stack which I have no idea what’s going on under the hood so I am finding it very hard to troubleshoot!

Advertisement

Answer

“expression requires stream name as a parameter” is I think an older version error message, a version of EPL that only allowed streams names for expression parameters. Try and go with the current version that doesn’t have this limitation.

Your EPL has more going on than was asked in the question. When asking a question its better to stay focused on just and only that which is relevant to the specific question. Please edit the question and remove all unrelated stuff. Asking one clear minimal question per post helps me save time.

Since you insist on the old version, you can use just insert into like so:

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement