Try using EMIT FINAL instead of EMIT CHANGES – you should set an appropriate grace-period though (otherwise it default to 24h). Not though: EMIT FINAL uses an in-memory buffer and there is no guard against out-of-memory errors.
i cant find nothing about EMIT FINAL in documentation
is emit final persist or full memory ? example if after 5 min power off and after 1 min power on will continue processing or lose data from 5 min and start from zero ?
what is emit final collect in memory buffer in my example? will be collect LIST of all raw message in window range or only result for every user with increment ‘viewCount’ ?
i cant find nothing about EMIT FINAL in documentation
It’s not documented… Because of the issue that you could hit an out-of-memory error, we don’t document it – and usually advice to use it only with care…
is emit final persist or full memory ? example if after 5 min power off and after 1 min power on will continue processing or lose data from 5 min and start from zero ?
It’s persistent. – But note, that it applies to fail-over or server shutdown only. If you terminate a query, state will be cleaned up. There is no such thing as “pausing” a query in ksqlDB.
what is emit final collect in memory buffer in my example? will be collect LIST of all raw message in window range or only result for every user with increment ‘viewCount’ ?
Both the aggregation and EMIT final only store the aggregation result (not the raw input data).