1

I'm trying to use PySiddhi4 to run CEP in a Python-based environment. To get acquainted with the package, I tried to run the sample code provided by the Siddhi developers. Here's the link: https://wso2.github.io/PySiddhi/Run-PySiddhi4/

However, when I run the code, I obtain a JavaException error while instantiating siddhiAppRuntime. The siddhiApp query string is as follows:

siddhiApp = "define stream cseEventStream (symbol string, price float, volume long); " + \
"@info(name = 'query1') from cseEventStream[volume < 150] select symbol,price insert into outputStream;"

I obtain the following error description:

JVM exception occurred: Error between @ Line: 1. Position: 0 and @ Line: 1. Position: 1. Syntax error in SiddhiQL, extraneous input 'iddhiAp' expecting {<EOF>, ';'}.

I tried to play around with the spacing within the query string, but to no avail. Does anyone have a solution to this issue? Thanks a lot in advance!

Grainier
  • 1,634
  • 2
  • 17
  • 30
vanrzk
  • 11
  • 3

1 Answers1

0

PySiddhi4 is basically a wrapper to Java Siddhi CEP. There we use pyjnius [1] module to access Java classes as Python classes using JNI. However, it seems that there's this string encoding issue [2], [3] reported with (the released version of) pyjnius, and that causes the above issue.

So according to them, the workarounds are;

  1. Build pyjnius 1.1.1 with cython<0.2.7 (pip install cython==0.26)
  2. Clone the latest version of pyjnius from GitHub, which had fixed the bug but is not released yet.

Please try that and see. Do let us know if the workaround doesn't seem to be working, then we can try to fix it on PySiddhi itself.

[1] https://github.com/kivy/pyjnius

[2] https://github.com/kivy/pyjnius/issues/300

[3] https://github.com/kivy/pyjnius/issues/340

Grainier
  • 1,634
  • 2
  • 17
  • 30