Uploaded image for project: 'MariaDB ColumnStore'
  1. MariaDB ColumnStore
  2. MCOL-3343

Window Functions don't work with arithmetic operators or other functions

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.1.5, 1.2.3
    • Fix Version/s: 1.2.5
    • Component/s: ExeMgr
    • Labels:
      None
    • Sprint:
      2019-05, 2019-06

      Description

      Discovered during QA:

      create table tb1 (d1 decimal(7,2), i1 int)engine=columnstore;
      insert into tb1 values (7.12, 1), (12.12, 1);

      select (sum(d1)*100.0) div sum(sum(d1)) over (partition by i1) from tb1 group by i1;

      This results in a random output in 1.2, and a 0 output in 1.1. The answer is 100 as can be seen when using innodb:
      MariaDB [dhall]> select (sum(d1)*100.0) div sum(sum(d1)) over (partition by i1) from inno_tb1 group by i1;
      ---------------------------------------------------------

      (sum(d1)*100.0) div sum(sum(d1)) over (partition by i1)

      ---------------------------------------------------------

      100

      ---------------------------------------------------------
      1 row in set (0.008 sec)

      Using the divide operator '/' instead of the div function may result in a different set of random numbers.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              dleeyh Daniel Lee
              Reporter:
              David.Hall David Hall
              Votes:
              0 Vote for this issue
              Watchers:
              2 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.