Open p-litvinov opened 5 years ago
@p-litvinov Was this run on SP editor or worker runtime?
I had tried to run it on both runtimes: editor and worker. Every runtime has the issue in 4.4.0. But with 4.3.0 version it works without any exception with worker and editor.
It seems the data source is not initialized properly, did you see any other errors? Was the app deployed successfully?
Yes. App is deployed successfully and data source is initialized properly. I have another app where this aggregation with the same data source works in write mode. And it works fine. In the 4.3.0 both apps work fine with the data source.
Maybe in the 4.4.0 it needs some additional rule in the app when using an aggregation in the read only mode?
No, it does not, read-only mode need not connect to a source that's all. Siddi app with the read-only aggregation lets define an event table and see if we can connect to the data source.
This is not reproducible in our end.
Description: The error occured in WSO2-SP 4.4.0 when trying to use read-only aggregation from @store. In the WSO2-SP 4.3.0 it works fine.
Suggested Labels:
Suggested Assignees:
Affected Product Version:
OS, DB, other environment details and versions:
Steps to reproduce: Create a aggregation with store in DB Postgres or Mysql. Put several events in the aggregation. Run the second script with read-only aggregation: `@App:name("demoError1") @App:description("Aggregation with store exception.")
-- Trade aggregation, read-only --
define stream TradesVolumeFake( timestamp long, exchange string, client_id string, trade_volume double ); @store(type = 'rdbms' , datasource = 'AF2_DB') @purge(enable="false") define aggregation TradeClientAggregation from TradesVolumeFake select exchange, client_id, sum(trade_volume) as totalVolume, max(trade_volume) as maxVolume, min(trade_volume) as minVolume, count() as countTrades group by exchange, client_id aggregate by timestamp every sec ... year; define trigger TriggerPreLoadTrades at 'start'; define stream RebuildCmd (t int);
@sink(type='log', prefix='CalcStream') define stream CalcStream(_timestamp long, exchange string, client_id string, countTrades long); from TriggerPreLoadTrades select 1 as t insert into RebuildCmd; from RebuildCmd as cmd right outer join TradeClientAggregation as agg on not (agg.exchange is null) --agg.exchange =='moex.eq' and agg.client_id == 'BC15981' within -- '2019-05-09 00:00:00', '2019-05-15 00:00:00' -- for tests only -- time:timestampInMilliseconds(time:dateSub(time:dateFormat(currentTimeMillis(), 'yyyy-MM-dd 00:00:00.000'),100,'DAY','yyyy-MM-dd HH:mm:ss.SSS')), -- 100 DAYS is parameter time:timestampInMilliseconds(time:dateFormat(currentTimeMillis(), 'yyyy-MM-dd 00:00:00.000')) per 'minutes' select agg.AGG_TIMESTAMP as _timestamp, agg.exchange as exchange, agg.client_id as client_id, agg.countTrades as countTrades --- time:dateFormat(agg.AGG_TIMESTAMP, 'yyyy-MM-dd HH:mm:ss') as time order by _timestamp ---limit 10 insert into CalcStream;`
Related Issues: