Description: Im trying to make windows with a length batch of 100 rows each and to use some R functions to calculate some statistical data for each batch. In the below code I:
define a inputstream
I create a query to convert the features into the right datatype
In the below query I make window batches for 100 rows each and im getting the max and standard deviation value for the "Result" feature. I the below code I use some simple R functions that are also available in Siddhi. But I also want to use more complex R functions to calculate the autocorrelation for example.
When I run the code below it works for the first 100 rows only. I want to do this for batch 1-100, 101-200, 201-300 etc. How can I do this? What am I doing wrong?
define stream HStream(mID, result String);
@sink(type='log', prefix='LOGGER')
define stream OutputStream(mID int, maxValue double, sdValue double);
@info(name = 'Query')
from HStream
select convert(mID, 'int') as mID, convert(str:replaceAll(result,',','.'), 'double') as result
insert into RStream;
@info(name = 'RStream')
from RStream#window.lengthBatch(100)#r:eval("c <- max(result); m <- sd(result);", "c double, m double ", result, result)
select mID, c as maxValue , m as sdValue
insert into OutputStream;
Description: Im trying to make windows with a length batch of 100 rows each and to use some R functions to calculate some statistical data for each batch. In the below code I:
Affected Product Version: WSO2 Stream Processor 4.4.0
Code: