Details
-
Task
-
Status: Stalled (View Workflow)
-
Minor
-
Resolution: Unresolved
-
None
-
10.2.4-4
Description
With a few exceptions, most native aggregate functions are supported as window functions.
https://mariadb.com/kb/en/library/aggregate-functions-as-window-functions/
In MDEV-7773, support for creating of custom aggregate functions was added.
This task proposes to extend that feature and allow custom aggregate functions to be used as window functions
An example of a creating a custom aggregate function is given below:
create aggregate function agg_sum(x INT) returns double |
begin
|
declare z double default 0; |
declare continue handler for not found return z; |
loop
|
fetch group next row; |
set z = z + x; |
end loop; |
end| |
This functions can be used in the following query:
create table balances (id int, amount int); |
insert into balances values (1, 10), (2, 20), (3, 30); |
|
select agg_sum(amount) from balances; |
After this task is complete the following must also work:
select agg_sum(amount) over (order by id); |
Attachments
Issue Links
- relates to
-
MDEV-7773 Aggregate stored functions
-
- Closed
-
Activity
Field | Original Value | New Value |
---|---|---|
Status | Open [ 1 ] | In Progress [ 3 ] |
Sprint | 10.2.4-3 [ 115 ] |
Rank | Ranked higher |
Sprint | 10.2.4-3 [ 115 ] | 10.2.4-4 [ 117 ] |
Rank | Ranked higher |
Priority | Major [ 3 ] | Minor [ 4 ] |
Status | In Progress [ 3 ] | Stalled [ 10000 ] |
Fix Version/s | 10.4 [ 22408 ] | |
Fix Version/s | 10.3 [ 22126 ] |
Description |
This is an extension to the task |
This is an extension to the task Currently only a few aggregate function are supported as window functions, the list can be found here https://mariadb.com/kb/en/library/aggregate-functions-as-window-functions/ So in |
Description |
This is an extension to the task Currently only a few aggregate function are supported as window functions, the list can be found here https://mariadb.com/kb/en/library/aggregate-functions-as-window-functions/ So in |
Currently only a few aggregate function are supported as window functions, the list can be found here
https://mariadb.com/kb/en/library/aggregate-functions-as-window-functions/ So in Now this task would deal with extending that feature and make custom aggregate functions behave as window functions An example of a creating a custom aggregate function is given below: {code:sql} create aggregate function agg_sum(x INT) returns double begin declare z double default 0; declare continue handler for not found return z; loop fetch group next row; set z = z + x; end loop; end| {code} |
Labels | gsoc18 |
Fix Version/s | 10.4 [ 22408 ] |
Labels | gsoc18 | gsoc18 gsoc19 |
Component/s | Optimizer [ 10200 ] |
Component/s | Optimizer - Window functions [ 13502 ] | |
Component/s | Optimizer [ 10200 ] |
Component/s | Stored routines [ 13905 ] | |
Component/s | Optimizer - Window functions [ 13502 ] |
Component/s | Optimizer - Window functions [ 13502 ] |
Description |
Currently only a few aggregate function are supported as window functions, the list can be found here
https://mariadb.com/kb/en/library/aggregate-functions-as-window-functions/ So in Now this task would deal with extending that feature and make custom aggregate functions behave as window functions An example of a creating a custom aggregate function is given below: {code:sql} create aggregate function agg_sum(x INT) returns double begin declare z double default 0; declare continue handler for not found return z; loop fetch group next row; set z = z + x; end loop; end| {code} |
With a few exceptions, most native aggregate functions are supported as window functions.
https://mariadb.com/kb/en/library/aggregate-functions-as-window-functions/ In This task proposes to extend that feature and allow custom aggregate functions to be used as window functions An example of a creating a custom aggregate function is given below: {code:sql} create aggregate function agg_sum(x INT) returns double begin declare z double default 0; declare continue handler for not found return z; loop fetch group next row; set z = z + x; end loop; end| {code} This functions can be used in the following query: {code:sql} create table balances (id int, amount int); insert into balances values (1, 10), (2, 20), (3, 30); select agg_sum(amount) from balances; {code} After this task is complete the following must also work: {code:sql} select agg_sum(amount) over (order by id); {code} |
Labels | gsoc18 gsoc19 | gsoc18 gsoc19 gsoc20 |
Labels | gsoc18 gsoc19 gsoc20 | gsoc18 gsoc19 gsoc20 gsoc21 |
Labels | gsoc18 gsoc19 gsoc20 gsoc21 | gsoc18 gsoc19 gsoc20 |
Assignee | Varun Gupta [ varun ] | Sergei Petrunia [ psergey ] |
Workflow | MariaDB v3 [ 78256 ] | MariaDB v4 [ 131664 ] |
Hi Varun,
I'm a 3rd-year Computer Science student at the University of Toronto (Canada) and am considering taking up this task as a GSoC 2019 Project.
Could you provide a list of potential aggregate functions that need to be implemented?