This operator allow to stop stream processing based on a predicate or a counter. It closes the tree from itself to the top. Other branches of the tree continue to run.

  • predicate When the predicate returns true, the operator closes the stream
  • count When the number of incoming tuples reaches the count, the operator closes the stream


#PARSER PQL
#QUERY
/// Stop query after reading 100 input elements from System.person
stop = CLOSESTREAM({count=100},System.person)



#PARSER PQL
#ADDQUERY
twindowPerson = TIMEWINDOW({SIZE = [10, 'MINUTES']}, person)
twindowAuction = TIMEWINDOW({SIZE = [10, 'MINUTES']}, auction)
twindowBid = TIMEWINDOW({SIZE = [10, 'MINUTES']}, bid)
personWithAuction = JOIN({PREDICATE = 'person.id = auction.seller'}, twindowPerson, twindowAuction)
personWithAuctionAndBids = JOIN({PREDICATE = 'auction.id = bid.auction'}, personWithAuction, twindowBid)
highBids = SELECT({PREDICATE = 'bid.price > 150'}, personWithAuctionAndBids)

/// Close the stream after reading 100 inputs from highBids
close = CLOSESTREAM({COUNT = 100}, highBids)


#PARSER PQL
#QUERY
/// Stop query after reaching application timestamp 10000 from System.person
stop = CLOSESTREAM({predicate="TimeInterval.START>10000"},System.person)


  • No labels