Using Siddhi 3.0.3 as Java library.
I've developed custom aggregation functions by extending AttributeAggregator
class, and I've seen some strange behavior after processRemove()
method is called. When processRemove()
is called, I remove the value and return the new aggregation result. However, the event returned by result handler is still receiving the old value. However, processAdd()
is working correctly. After some debugging, I've noticed that after each call to processAdd()
, the result events contain the object returned by the last call to processAdd()
. However, after a call to processRemove()
, the event contains the same object it had before (that from last processAdd()
), not the last object returned by processRemove()
.
If I maintain a collection, adding removing from it and always returning the same collection object, all is good. But for aggregation functions that return numeric values, each processAdd()
/processRemove()
return a boxed Long
, which does not get replaced with the return from processRemove()
.
I've also noticed this same behavior using the built-in aggregate function count()
.