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

group_concat with distinct concatenates even non-distinct values

Details

    • Bug
    • Status: Closed (View Workflow)
    • Minor
    • Resolution: Fixed
    • 1.0.15, 1.1.6, 1.2.2
    • 1.4.0
    • ExeMgr
    • None
    • 2019-06

    Description

      If the group_concat contains distinct together with sorting over non-distinct column CS concatenates distinct values multiple times.

      Here is the setting:

      create table cs1 (i bigint, a bigint) engine=columnstore;
      insert into cs1 values (1,2),(1,3),(2,5),(1,42);
      

      MariaDB [tpch1]> select group_concat(distinct i order by a) s from cs1;
      +---------+
      | s       |
      +---------+
      | 1,1,2,1 |
      +---------+
      1 row in set (0.031 sec)
      

      Attachments

        Issue Links

          Activity

            drrtuy Roman added a comment - - edited

            IdbOrderBy::Hasher::operator() and IdbOrderBy::Eq::operator() both don't exempt non-distinct columns from calculation when they call Row::hash() and Row:eq() respectively. Hasher and Eq operators must sent down the stack the column count equals with distinct columns count.
            LimitedOrderBy is protected by an error message group_concat doesn't have such barrier. We should remove the error message for LimitedOrderBy when resolve the issue and get extra feature - distinct sorting by non-projected columns.

            drrtuy Roman added a comment - - edited IdbOrderBy::Hasher::operator() and IdbOrderBy::Eq::operator() both don't exempt non-distinct columns from calculation when they call Row::hash() and Row:eq() respectively. Hasher and Eq operators must sent down the stack the column count equals with distinct columns count. LimitedOrderBy is protected by an error message group_concat doesn't have such barrier. We should remove the error message for LimitedOrderBy when resolve the issue and get extra feature - distinct sorting by non-projected columns.

            Build verified: 1.4.0-1

            [dlee@master centos7]$ cat gitversionInfo.txt
            engine commit:
            1f47534

            MariaDB [mytest]> create table cs1 (i bigint, a bigint) engine=columnstore;
            Query OK, 0 rows affected (0.230 sec)

            MariaDB [mytest]> insert into cs1 values (1,2),(1,3),(2,5),(1,42);
            Query OK, 4 rows affected (1.239 sec)
            Records: 4 Duplicates: 0 Warnings: 0

            MariaDB [mytest]> select group_concat(distinct i order by a) s from cs1;
            ------

            s

            ------

            1,2

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

            dleeyh Daniel Lee (Inactive) added a comment - Build verified: 1.4.0-1 [dlee@master centos7] $ cat gitversionInfo.txt engine commit: 1f47534 MariaDB [mytest] > create table cs1 (i bigint, a bigint) engine=columnstore; Query OK, 0 rows affected (0.230 sec) MariaDB [mytest] > insert into cs1 values (1,2),(1,3),(2,5),(1,42); Query OK, 4 rows affected (1.239 sec) Records: 4 Duplicates: 0 Warnings: 0 MariaDB [mytest] > select group_concat(distinct i order by a) s from cs1; ------ s ------ 1,2 ------ 1 row in set (0.533 sec)

            People

              dleeyh Daniel Lee (Inactive)
              drrtuy Roman
              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.