Julian Hyde created CALCITE-1237:
------------------------------------

             Summary: Session windows for streaming SQL
                 Key: CALCITE-1237
                 URL: https://issues.apache.org/jira/browse/CALCITE-1237
             Project: Calcite
          Issue Type: Bug
            Reporter: Julian Hyde
            Assignee: Julian Hyde


A session window is a collection of rows whose key values, when sorted, have a 
gap of at most N.

(Should "at most" be "less than"?)

The key type can be any type that has a minus operator, that is, numeric and 
date-time.

I propose the following syntax: {{session(key [, ...]*, interval)}}. For 
example:

{code}
select stream session(rowtime, productId, interval '5' second),
  productId, count(*) as c
from Orders
group by session(rowtime, productId, interval '5' second),
  productId
{code}

to find bursts of orders for the same product where consecutive orders are no 
more than 5 seconds apart.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to