0
votes

Not getting expected behavior, my flink application getting live event and my trigger condition is depend on two event ABC and XYZ. when both event reach then trigger the notification.

application is using StreamTableEnviornment

here is the sql query that I am using

SELECT  * 
from EventTable 
where eventName in ('ABC','XYZ') 
and 1 IN (select 1 from EventTable where name='XYZ') 
and 1 IN (select 1 from EventTable where name='ABC')

use case: 1

ABC event comes -->nothing happens (as expected and waiting for XYZ event)

XYZ event comes --> condition match and sql query gives two event record(ABC &XYZ) and it trigger the notification (as expected)

Now again if I send 'ABC' event then sql query give the result ABC event and notification triggered.

I was expecting that query will not give result as only one event ABC reached and will wait for event XYZ. could you please help me with this behaviour? Am I missing something to get the expected result?

1

1 Answers

0
votes

When the second ABC is added to the dynamic table, the first XYZ is already there, so the conditions are met. The addition of this third row to the input table causes one new row to be appended to the output table.

See Dynamic Tables in the documentation for more information about the model underlying stream SQL.