You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@drill.apache.org by "Timothy Chen (JIRA)" <ji...@apache.org> on 2013/03/01 06:23:12 UTC

[jira] [Updated] (DRILL-31) Implement WindowsFrame Reference Operator

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

Timothy Chen updated DRILL-31:
------------------------------

    Description: 
Window Frame (1)

For each record of an incoming stream (let’s call this the target record), the window operator will create a segment containing the records in a sliding window surrounding the target record. The sliding window will include a specified number of records before and/or after the target record.  The window frame operator can operate across an entire input stream or can be told to only allow operations within each incoming segment.
A simple example: a window range of -2 start and 0 end is applied to a 5 record single segment input [0,1,2,3,4].  This would result in an output of 12 rows (brackets describe each output segment)  [0] [0,1] [0,1,2] [1,2,3] [2,3,4].  Each output record would have contain two additional fields: ref.segment which holds the current window segment and ref.position which will the negative, positive or zero position within the window.  For the example data, the values to each of these would be: ref.segment: [0,1,1,2,2,2,3,3,3,4,4,4], ref.position: [0,-1,0,-1,0,1,-1,0,1,-1,0,1]
A window operator can also optionally take a segment key as input.  This key is used to restrict the windows so that they do not cross segment boundaries.  The window operator takes as inputs a ‘start’ and an ‘end’ value.  These values define the range of the window.  The window range is defined based on thinking of the target record as zero, and each record after incrementing positively and each record before incrementing negatively.  In the case that start or end is not defined, that portion of the range will be unbounded.  In all cases, start must be greater than or equal to end.  At least one of start or end must be defined.  
{ @id†: <opref>, op: “windowframe”, 

  input†: <input>, 

  within*: <name>,

  start*: <number>, 

  end*: <number>

  ref: {

    segment: <name>, 

    position: <name> 

  },


}

  was:
For each record of an incoming stream (let’s call this the target record), the window operator will create a segment containing the records in a sliding window surrounding the target record. The sliding window will include a specified number of records before and/or after the target record.  The window frame operator can operate across an entire input stream or can be told to only allow operations within each incoming segment.
A simple example: a window range of 2 before and 0 after is applied to a 5 record single segment input [0,1,2,3,4].  This would result in an output of 12 rows (brackets describe each output segment)  [0] [0,1] [0,1,2] [1,2,3] [2,3,4].  Each output record would have contain two additional fields: ref.segment which holds the current window segment and ref.position which will the negative, positive or zero position within the window.  For the example data, the values to each of these would be: ref.segment: [0,1,1,2,2,2,3,3,3,4,4,4], ref.position: [0,-1,0,-1,0,1,-1,0,1,-1,0,1]
A window operator can also optionally take a segment key as input.  This key is used to restrict the windows so that they do not cross segment boundaries.  The window operator takes as inputs a ‘start’ and an ‘end’ value.  These values define the range of the window.  The window range is defined based on thinking of the target record as zero, and each record after incrementing positively and each record incrementing negatively.  In the case that start or end is not defined, that portion of the range will be unbounded.  In all cases, start must be greater than or equal to end.  At least one of start or end must be defined.  
{ @id†: <opref>, op: “windowframe”, 

  input†: <input>, 

  within*: <name>,

  start*: <number>, 

  end*: <number>

  ref: {

    segment: <name>, 

    position: <name> 

  },


}

    
> Implement WindowsFrame Reference Operator
> -----------------------------------------
>
>                 Key: DRILL-31
>                 URL: https://issues.apache.org/jira/browse/DRILL-31
>             Project: Apache Drill
>          Issue Type: New Feature
>            Reporter: Timothy Chen
>            Assignee: Timothy Chen
>              Labels: logical
>
> Window Frame (1)
> For each record of an incoming stream (let’s call this the target record), the window operator will create a segment containing the records in a sliding window surrounding the target record. The sliding window will include a specified number of records before and/or after the target record.  The window frame operator can operate across an entire input stream or can be told to only allow operations within each incoming segment.
> A simple example: a window range of -2 start and 0 end is applied to a 5 record single segment input [0,1,2,3,4].  This would result in an output of 12 rows (brackets describe each output segment)  [0] [0,1] [0,1,2] [1,2,3] [2,3,4].  Each output record would have contain two additional fields: ref.segment which holds the current window segment and ref.position which will the negative, positive or zero position within the window.  For the example data, the values to each of these would be: ref.segment: [0,1,1,2,2,2,3,3,3,4,4,4], ref.position: [0,-1,0,-1,0,1,-1,0,1,-1,0,1]
> A window operator can also optionally take a segment key as input.  This key is used to restrict the windows so that they do not cross segment boundaries.  The window operator takes as inputs a ‘start’ and an ‘end’ value.  These values define the range of the window.  The window range is defined based on thinking of the target record as zero, and each record after incrementing positively and each record before incrementing negatively.  In the case that start or end is not defined, that portion of the range will be unbounded.  In all cases, start must be greater than or equal to end.  At least one of start or end must be defined.  
> { @id†: <opref>, op: “windowframe”, 
>   input†: <input>, 
>   within*: <name>,
>   start*: <number>, 
>   end*: <number>
>   ref: {
>     segment: <name>, 
>     position: <name> 
>   },
> }

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira