Hi,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. When I 
run the code below it works for the first 100 rows. As u can see in the output 
below. But the output below only gives a log of the first batch of 100 rows. I 
want to do this for batch 1-100, 101-200, 201-300 etc. How can I do this? What 
am I doing wrong?

[2019-11-13_14-43-11_280] INFO 
{org.wso2.siddhi.core.stream.output.sink.LogSink} - LOGGER : 
Event{timestamp=1573652690107, data=[100, 96.73, 11.004484222861702], 
isExpired=false}

define stream HBA1CStream(measurementID String, dateTime String, result String, 
unixDateTime String);@sink(type='log', prefix='LOGGER')define stream 
OutputStream(measurementID int, maxValue double, sdValue double);@info(name = 
'Query')from HBA1CStreamselect convert(measurementID, 'int') as measurementID, 
convert(str:replaceAll(result,',','.'), 'double') as result, dateTime, 
convert(unixDateTime, 'long') as unixDateTimeinsert 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 measurementID, c as 
maxValue , m as sdValueinsert into OutputStream;

Thanks for the help.

Best regards,
Wiedo

_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to