Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

...

Code Block
from overdueDeliveries as overdueStream unidirectional join pizza_deliveries 
on pizza_deliveries.order_id == overdueStream.orderNo 
select count(overdueStream.orderNo) as sumOrderId, overdueStream.customerName
insert into deliveredOrders;

In the The above query,

  • Joins pizza_deliveries table with the overdueDeliveries stream (the alias overdueStream is used for convenience here)
  • The Uses a join operation compares to compare each event in the event table (pizza_deliveries) with each incoming event from overdueDeliveries stream
    Note that,
    • Events received through the overdueDeliveries arrive 30 seconds after the actual order happens
    • A result of this join operation indicates (since we match the order ids) that the order is already delivered within 30 seconds
  • Inserts the successful delivery information to the deliveredOrders stream, which can be used to monitor the status of orders

...