Details

    • 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

          Activity

            varun Varun Gupta (Inactive) created issue -
            varun Varun Gupta (Inactive) made changes -
            Field Original Value New Value
            Status Open [ 1 ] In Progress [ 3 ]
            ratzpo Rasmus Johansson (Inactive) made changes -
            Sprint 10.2.4-3 [ 115 ]
            ratzpo Rasmus Johansson (Inactive) made changes -
            Rank Ranked higher
            ratzpo Rasmus Johansson (Inactive) made changes -
            Sprint 10.2.4-3 [ 115 ] 10.2.4-4 [ 117 ]
            ratzpo Rasmus Johansson (Inactive) made changes -
            Rank Ranked higher
            varun Varun Gupta (Inactive) made changes -
            Priority Major [ 3 ] Minor [ 4 ]
            varun Varun Gupta (Inactive) made changes -
            Status In Progress [ 3 ] Stalled [ 10000 ]
            elenst Elena Stepanova made changes -
            varun Varun Gupta (Inactive) made changes -
            Fix Version/s 10.4 [ 22408 ]
            Fix Version/s 10.3 [ 22126 ]
            varun Varun Gupta (Inactive) made changes -
            Description This is an extension to the task MDEV-7773. Here we are going to add support to aggregate functions so that they behave as window functions. This is an extension to the task MDEV-7773. Here we are going to add support to aggregate functions so that they behave as window functions.

            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 MDEV-7773, support for creating of custom aggregate functions was added.








            varun Varun Gupta (Inactive) made changes -
            Description This is an extension to the task MDEV-7773. Here we are going to add support to aggregate functions so that they behave as window functions.

            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 MDEV-7773, support for creating of custom aggregate functions was added.








            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 MDEV-7773, support for creating of custom aggregate functions was added.
            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}




            varun Varun Gupta (Inactive) made changes -
            Labels gsoc18
            varun Varun Gupta (Inactive) made changes -
            Fix Version/s 10.4 [ 22408 ]
            ratzpo Rasmus Johansson (Inactive) made changes -
            Labels gsoc18 gsoc18 gsoc19
            serg Sergei Golubchik made changes -
            Component/s Optimizer [ 10200 ]
            serg Sergei Golubchik made changes -
            Component/s Optimizer - Window functions [ 13502 ]
            Component/s Optimizer [ 10200 ]
            serg Sergei Golubchik made changes -
            Component/s Stored routines [ 13905 ]
            Component/s Optimizer - Window functions [ 13502 ]
            serg Sergei Golubchik made changes -
            Component/s Optimizer - Window functions [ 13502 ]
            cvicentiu Vicențiu Ciorbaru made changes -
            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 MDEV-7773, support for creating of custom aggregate functions was added.
            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 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:

            {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}
            cvicentiu Vicențiu Ciorbaru made changes -
            Labels gsoc18 gsoc19 gsoc18 gsoc19 gsoc20
            cvicentiu Vicențiu Ciorbaru made changes -
            Labels gsoc18 gsoc19 gsoc20 gsoc18 gsoc19 gsoc20 gsoc21
            cvicentiu Vicențiu Ciorbaru made changes -
            Labels gsoc18 gsoc19 gsoc20 gsoc21 gsoc18 gsoc19 gsoc20
            julien.fritsch Julien Fritsch made changes -
            Assignee Varun Gupta [ varun ] Sergei Petrunia [ psergey ]
            serg Sergei Golubchik made changes -
            Workflow MariaDB v3 [ 78256 ] MariaDB v4 [ 131664 ]

            People

              psergei Sergei Petrunia
              varun Varun Gupta (Inactive)
              Votes:
              1 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

                Created:
                Updated:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.