[ 
https://issues.apache.org/jira/browse/CALCITE-3737?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Rui Wang updated CALCITE-3737:
------------------------------
    Description: 
Hopping windows place intervals of a fixed size evenly spaced across event 
time. Most importantly, in the most common use a given event time timestamp 
will generally fall into more than one window.
The table-valued function Hop may produce zero, one, or multiple rows 
corresponding to each row of input.  Hop takes four required parameters and one 
optional parameter. All parameters are analogous to those for Tumble except for 
hopsize, which specifies the duration between the starting points (and 
endpoints) of the hopping windows, allowing for overlapping windows (hopsize < 
dur, common) or gaps in the data (hopsize > dur, rarely useful).
Hop (data , timecol , dur, hopsize,[ offset ])
data is a table parameter that can be any relation with an event time column.
timecol is a column descriptor indicating which event time column of data 
should be mapped to tumbling windows.
dur is a duration specifying the width of the hopping windows.
hopsize is a duration specifying the duration between the start of sequential 
hopping windows
offset (optional) specifies that the hopping should begin from an instant other 
than the standard beginning of the epoch
The return value of Hop is a relation that includes all columns of data as well 
as additional event time columns wstart and wend. Here is an example invocation 
on the Bid table from the paper:
8:21> SELECT *
      FROM Hop (
        data    => TABLE Bids ,
        timecol => DESCRIPTOR ( bidtime ) ,
        dur     => INTERVAL '10' MINUTES ,
        hopsize => INTERVAL '5' MINUTES );

------------------------------------------
| wstart | wend | bidtime | price | item |
------------------------------------------
| 8:00   | 8:10 | 8:07    | $2    | A    |
| 8:05   | 8:15 | 8:07    | $2    | A    |
| 8:05   | 8:15 | 8:11    | $3    | B    |
| 8:10   | 8:20 | 8:11    | $3    | B    |
| 8:00   | 8:10 | 8:05    | $4    | C    |
| 8:05   | 8:15 | 8:05    | $4    | C    |
| 8:00   | 8:10 | 8:09    | $5    | D    |
| 8:05   | 8:15 | 8:09    | $5    | D    |
| 8:05   | 8:15 | 8:13    | $1    | E    |
| 8:10   | 8:20 | 8:13    | $1    | E    |
| 8:10   | 8:20 | 8:17    | $6    | F    |
| 8:15   | 8:25 | 8:17    | $6    | F    |
------------------------------------------


> HOP Table-valued Function
> -------------------------
>
>                 Key: CALCITE-3737
>                 URL: https://issues.apache.org/jira/browse/CALCITE-3737
>             Project: Calcite
>          Issue Type: Sub-task
>            Reporter: Rui Wang
>            Assignee: Rui Wang
>            Priority: Major
>
> Hopping windows place intervals of a fixed size evenly spaced across event 
> time. Most importantly, in the most common use a given event time timestamp 
> will generally fall into more than one window.
> The table-valued function Hop may produce zero, one, or multiple rows 
> corresponding to each row of input.  Hop takes four required parameters and 
> one optional parameter. All parameters are analogous to those for Tumble 
> except for hopsize, which specifies the duration between the starting points 
> (and endpoints) of the hopping windows, allowing for overlapping windows 
> (hopsize < dur, common) or gaps in the data (hopsize > dur, rarely useful).
> Hop (data , timecol , dur, hopsize,[ offset ])
> data is a table parameter that can be any relation with an event time column.
> timecol is a column descriptor indicating which event time column of data 
> should be mapped to tumbling windows.
> dur is a duration specifying the width of the hopping windows.
> hopsize is a duration specifying the duration between the start of sequential 
> hopping windows
> offset (optional) specifies that the hopping should begin from an instant 
> other than the standard beginning of the epoch
> The return value of Hop is a relation that includes all columns of data as 
> well as additional event time columns wstart and wend. Here is an example 
> invocation on the Bid table from the paper:
> 8:21> SELECT *
>       FROM Hop (
>         data    => TABLE Bids ,
>         timecol => DESCRIPTOR ( bidtime ) ,
>         dur     => INTERVAL '10' MINUTES ,
>         hopsize => INTERVAL '5' MINUTES );
> ------------------------------------------
> | wstart | wend | bidtime | price | item |
> ------------------------------------------
> | 8:00   | 8:10 | 8:07    | $2    | A    |
> | 8:05   | 8:15 | 8:07    | $2    | A    |
> | 8:05   | 8:15 | 8:11    | $3    | B    |
> | 8:10   | 8:20 | 8:11    | $3    | B    |
> | 8:00   | 8:10 | 8:05    | $4    | C    |
> | 8:05   | 8:15 | 8:05    | $4    | C    |
> | 8:00   | 8:10 | 8:09    | $5    | D    |
> | 8:05   | 8:15 | 8:09    | $5    | D    |
> | 8:05   | 8:15 | 8:13    | $1    | E    |
> | 8:10   | 8:20 | 8:13    | $1    | E    |
> | 8:10   | 8:20 | 8:17    | $6    | F    |
> | 8:15   | 8:25 | 8:17    | $6    | F    |
> ------------------------------------------



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to