Tuple Based Windows Clause Samples
Tuple Based Windows. Using the same input streams, the question “What is the total amount spent by ▇▇▇▇ on his latest ten purchases from ▇▇▇▇?" can be expressed using the following CQL query: SELECT SUM(P. cost ) FROM Auctions AS A, Purchases [ ROWS 10] AS P WHERE A. auction_id = P. auction_id AND A. seller = " ▇▇▇▇ "; AND P. buyer = " Luke "; The query differs from the previous one in that we now use a tuple based window. ROWS is similar to RANGE, with the difference that while RANGE defines a window based on time, the ROWS operator expects a physical window size N, i.e., a maximum number of tuples that may be included in the sliding window.
