Hi Mans,

For understanding the difference between FIRE and FIRE_AND_PURGE it's helpful 
to look at the cases where it really makes a difference. In my opinion this 
only makes a difference when you have event-time windowing and when you have 
multiple firing for the same window (i.e. multiple firings for the window 
[12:00,13:00) for a key x). You have this either when you have late data or 
when you have a custom trigger that can fire speculatively. Let's look at the 
first case and see where FIRE/FIRE_AND_PURGE act differently.

Assume we have window assigner = "tumbling windows of 10 ms" and allowed 
lateness 5 ms. We get this data:

event1, ts = 1
watermark, ts = 11
event2, ts = 2

What we get from this is a firing when the watermark arrives with the window 
contents (event1) for window [0, 9). Then, when event2 arrives we get a second 
firing (because the default event-time trigger will FIRE when late data arrives 
for a window) for window [0, 9) with contents (event1, event2) if our trigger 
returns FIRE or with contents (event2) if our trigger returns FIRE_AND_PURGE.

If we had allowed lateness 0 ms we wouldn't have the second firing for the late 
event and we wouldn't see a difference between FIRE and FIRE_AND_PURGE.

This can be extended to the second case of a custom trigger that might fire 
early (based on the count of events in the window or processing time).

I hope this helps.
Aljoscha

> On 20. Nov 2017, at 11:18, Stefan Richter <s.rich...@data-artisans.com> wrote:
> 
> Hi,
> 
>> 
>> "In the first case, it is a new window without the previous elements, in the 
>> second case the window reflects the old contents plus all changes since the 
>> last trigger."
>> 
>> I am assuming the first case is FIRE and second case is FIRE_AND_PURGE - I 
>> was thinking that in the first case (FIRE), there would be elements from 
>> previous window since we did not purge and the second case it would have 
>> only new elements since it was purged.  Am I missing something ?  
>>> 
> 
> No, with first case, I meant the „truly new window case“ and the second case 
> is „another triggering of the previous (non-purged) window“. So the second 
> case is a simple FIRE without PURGE.
> 
> Best,
> Stefan

Reply via email to