GitHub user shixuan-fan opened a pull request:
https://github.com/apache/incubator-quickstep/pull/58
QUICKSTEP-20: Supported Window Aggregation for AVG
Quickstep could now make the calculation for window aggregation function
average. The work-flow is:
`ExecutionGenerator` constructs `WindowAggregationOperator` and initializes
`WindowAggregationOperationState`
=> `WindowAggregationOperator::execute()` is called
=> `WindowAggregationOperationState::windowAggregate()`: combines all
blocks' tuples into one `ValueAccessor`
=> `WindowAggregationHandle::calculate()`: actually does the calculation
and return a `ColumnVector*` including all the calculated window aggregates
=> `WindowAggregationOperationState::windowAggregate()` will add the new
`ColumnVector` into the created `ValueAccessor` and output the result to the
`output_destination`.
We are using the simplest approach for the calculation: one thread will
iterate through all the tuples. For each tuple, the thread will find all the
elements in the given window and calculate the result.
In current version, we don't support `RANGE` frame mode. Also, other
functions' handle will be created in the next PR.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/apache/incubator-quickstep
SQL-window-aggregation
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/incubator-quickstep/pull/58.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #58
----
commit 2966405066b223d0079f8df3e231ed56750259ad
Author: shixuan-fan <[email protected]>
Date: 2016-07-08T18:23:47Z
Added handle for avg
commit d5f535ee9f0e3c7a8ea7615a07699b83c5f905f4
Author: shixuan-fan <[email protected]>
Date: 2016-07-11T14:11:47Z
Seperated calculation into two parts to check intermediate result
commit 897ffc6db0e177caf73131b39c80d6d077087c8e
Author: shixuan-fan <[email protected]>
Date: 2016-07-12T04:54:20Z
Fixed SegFault
commit f4eb4a7ccff40d278a4f4e32737edc5f93fb7419
Author: shixuan-fan <[email protected]>
Date: 2016-07-12T19:12:36Z
Fixed empty table when p_key or o_key specified
commit e16fdf75240a705a6d18a841cf94bcd78619f077
Author: shixuan-fan <[email protected]>
Date: 2016-07-12T19:48:59Z
Minor fix
commit c50ce513941842c7ae7108ddb76054304514587a
Author: shixuan-fan <[email protected]>
Date: 2016-07-13T17:00:41Z
Let WindowAggregationOperationState handle data copying
commit 0f5c41d1531032065e747b642b9013802f74ac06
Author: shixuan-fan <[email protected]>
Date: 2016-07-13T21:26:29Z
Removed finalize()
commit 5f4647b73a57981838540185bf0bc63e80a3c1dd
Author: shixuan-fan <[email protected]>
Date: 2016-07-14T16:29:08Z
Added unittest for avg on Cumulative aggregation and sliding window
commit 727761bb083a197698db7e0f155a95c9f6b60cf6
Author: shixuan-fan <[email protected]>
Date: 2016-07-15T17:30:53Z
Added WindowAggregateFunctions for other functions without handle
commit ab9dc8b525ef5e24f9b821d23ea6ac6bc88e594e
Author: shixuan-fan <[email protected]>
Date: 2016-07-15T17:38:05Z
Added all-in-one module
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---