I'm looking for a way to get a canonical representation of operators (number and type of Projects, Selects, ...) and the way they are linked together as used in Esper's EPL statements, such as:
SELECT x,y,z,ts FROM AccelEvents WHERE vibe=0
SELECT x*x+y*y+z*z AS ed, ts FROM FilteredEvents
SELECT Math.pow(ed,0.5) as sqrted, ts FROM EdEvents
SELECT r1('ts') as ts FROM SqrtEdEvents
MATCH_RECOGNIZE (MEASURES A AS r1, B AS r2 PATTERN (A B)
DEFINE A AS (A.sqrted > THR), B AS (B.sqrted <= THR))
I would be grateful for something similar to what Apache Calcite offers when parsing a query:
LogicalTableModify(table=[[OverallSchema, EdEvents]], operation=[INSERT], updateColumnList=[[]], flattened=[true])
LogicalProject(ed=[+(+(*($0, $0), *($1, $1)), *($2, $2))], ts=[$3])
EnumerableTableScan(table=[[OverallSchema, FilteredEvents]])
However I can't find any pointers for an equivalent in Esper from Esper's extensive documentation and unfortunately Calcite doesn't yet offer level of functionality I require, especially for streaming data.
Any pointers would be greatly appreciated.
I think you are looking for this: http://espertech.com/esper/release-5.5.0/esper-reference/html_single/index.html#api-soda