Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-15073

Generic UDAF parser code in server for windows functions

Details

    • Task
    • Status: Closed (View Workflow)
    • Critical
    • Resolution: Fixed
    • 10.4.1
    • OTHER
    • None

    Description

      We currently have a patched in MariaDB's parser to support UDAFs. We need to work with the server team to do this in a more generic way.

      Attachments

        Activity

          LinuxJedi Andrew Hutchings (Inactive) created issue -
          LinuxJedi Andrew Hutchings (Inactive) made changes -
          Field Original Value New Value
          Epic Link MCOL-1097 [ 64777 ]

          Current patch used by ColumnStore for UDAF window functions:

          @@ -10482,6 +10478,29 @@ window_func:
                   |
                     sum_expr
                     {
          +            ((Item_sum *) $1)->mark_as_window_func_sum_expr();
          +          }
          +        |
          +          function_call_generic
          +          {
          +            /*
          +            We want to allow UDF aggregate (UDAF) functions as Window functions.
          +            function_call_generic handles UDAF, so we leverage
          +            that and then filter out anything that isn't a UDAF.
          +            */
          +        Item* item = (Item*)$1;
          +            if (item == NULL)
          +        {
          +              my_error(ER_SP_DOES_NOT_EXIST, MYF(0), "FUNCTION", "");
          +              MYSQL_YYABORT;
          +        }
          +            if ((item->type() != Item::SUM_FUNC_ITEM)
          +        || (((Item_sum *)item)->sum_func() != Item_sum::UDF_SUM_FUNC))
          +        {
          +              my_error(ER_SP_DOES_NOT_EXIST, MYF(0), "FUNCTION", ((Item_func_sp*)item)->func_name());
          +              MYSQL_YYABORT;
          +        }
          +
                       ((Item_sum *) $1)->mark_as_window_func_sum_expr();
                     }
                   ;
          

          LinuxJedi Andrew Hutchings (Inactive) added a comment - Current patch used by ColumnStore for UDAF window functions: @@ -10482,6 +10478,29 @@ window_func: | sum_expr { + ((Item_sum *) $1)->mark_as_window_func_sum_expr(); + } + | + function_call_generic + { + /* + We want to allow UDF aggregate (UDAF) functions as Window functions. + function_call_generic handles UDAF, so we leverage + that and then filter out anything that isn't a UDAF. + */ + Item* item = (Item*)$1; + if (item == NULL) + { + my_error(ER_SP_DOES_NOT_EXIST, MYF(0), "FUNCTION", ""); + MYSQL_YYABORT; + } + if ((item->type() != Item::SUM_FUNC_ITEM) + || (((Item_sum *)item)->sum_func() != Item_sum::UDF_SUM_FUNC)) + { + my_error(ER_SP_DOES_NOT_EXIST, MYF(0), "FUNCTION", ((Item_func_sp*)item)->func_name()); + MYSQL_YYABORT; + } + ((Item_sum *) $1)->mark_as_window_func_sum_expr(); } ;
          dthompson David Thompson (Inactive) made changes -
          Fix Version/s 1.3 [ 22101 ]
          Key MCOL-1110 MDEV-15073
          Workflow MariaDB ColumnStore workflow [ 84413 ] MariaDB v3 [ 85140 ]
          Issue Type New Feature [ 2 ] Task [ 3 ]
          Project MariaDB ColumnStore [ 10902 ] MariaDB Server [ 10000 ]
          ralf.gebhardt Ralf Gebhardt made changes -
          Fix Version/s 10.4 [ 22408 ]
          ralf.gebhardt Ralf Gebhardt made changes -
          Assignee Oleksandr Byelkin [ sanja ]
          ralf.gebhardt Ralf Gebhardt made changes -
          Priority Major [ 3 ] Critical [ 2 ]
          ralf.gebhardt Ralf Gebhardt made changes -
          julien.fritsch Julien Fritsch made changes -
          Epic Link MCOL-1097 [ 64777 ] PT-81 [ 68562 ]
          ralf.gebhardt Ralf Gebhardt made changes -
          Rank Ranked higher
          sanja Oleksandr Byelkin made changes -
          Status Open [ 1 ] In Progress [ 3 ]

          UDAF == User Defined Aggregate Function

          sanja Oleksandr Byelkin added a comment - UDAF == User Defined Aggregate Function
          sanja Oleksandr Byelkin made changes -
          Summary Generic UDAF parser code in server Generic UDAF parser code in server for windows functions
          sanja Oleksandr Byelkin added a comment - - edited

          The problem I see is that window function need other interface than usual aggregate.
          So it is not about only parser change and it is far from 1 day of work.

          sanja Oleksandr Byelkin added a comment - - edited The problem I see is that window function need other interface than usual aggregate. So it is not about only parser change and it is far from 1 day of work.
          sanja Oleksandr Byelkin made changes -
          Status In Progress [ 3 ] Stalled [ 10000 ]

          For more efficient window functions support support of *_remove() call added to UDF, aggregate without it also supported as a window function.

          sanja Oleksandr Byelkin added a comment - For more efficient window functions support support of *_remove() call added to UDF, aggregate without it also supported as a window function.
          sanja Oleksandr Byelkin made changes -
          Assignee Oleksandr Byelkin [ sanja ] Sergei Golubchik [ serg ]
          Status Stalled [ 10000 ] In Review [ 10002 ]

          I forgot to change ORACLE parser, but there changes will be the same.

          sanja Oleksandr Byelkin added a comment - I forgot to change ORACLE parser, but there changes will be the same.

          ok to push

          serg Sergei Golubchik added a comment - ok to push
          serg Sergei Golubchik made changes -
          Assignee Sergei Golubchik [ serg ] Oleksandr Byelkin [ sanja ]
          Status In Review [ 10002 ] Stalled [ 10000 ]
          sanja Oleksandr Byelkin made changes -
          Component/s OTHER [ 10125 ]
          Fix Version/s 10.4.1 [ 23228 ]
          Fix Version/s 10.4 [ 22408 ]
          Resolution Fixed [ 1 ]
          Status Stalled [ 10000 ] Closed [ 6 ]
          serg Sergei Golubchik made changes -
          Workflow MariaDB v3 [ 85140 ] MariaDB v4 [ 133420 ]

          People

            sanja Oleksandr Byelkin
            LinuxJedi Andrew Hutchings (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

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