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

Union ALL with wrapped selects -Groub BY -syntax err

Details

    Description

      A client is having issues with wrapped selects and UNION ALL. I'll attach their original DDL and query, but I have a simplified reproduction case here.

      # DDL & Data
      create table t2 ( a int, c varchar(50)) engine=columnstore;
      insert into t2 values (1, 'CT_PropDelay');
       
      # Query
      SELECT * FROM ( select a, c from t2 where c in ('x') group by a, c ) t
      UNION ALL
      SELECT * FROM ( select a, c from t2 where c in ('CT_PropDelay') group by a, c ) t
      

      • What happens today is an error is thrown:

        ERROR 1815 (HY000): Internal error: IDB-2021: 'c' is not in GROUP BY clause. All non-aggregate columns in the SELECT and ORDER BY clause must be included in the GROUP BY clause.
        

      • The expected outcome is for the query to run - with sample data it would look the same as

        +------+--------------+
        | a    | c            |
        +------+--------------+
        |    1 | CT_PropDelay |
        +------+--------------+
        1 rows in set (0.080 sec)
        

      Attachments

        Issue Links

          Activity

            For QA: Instructions for reproduction are in the ticket description. Please also confirm the attached SQL query runs without an error.

            tntnatbry Gagan Goel (Inactive) added a comment - For QA: Instructions for reproduction are in the ticket description. Please also confirm the attached SQL query runs without an error.

            Build verified:
            engine: 4d4e4ad30dd2ec494ea9d323e1fa7fa69e97243e
            server: 1916028f898cf672a8b79d2b585b1d74f8bcd7db
            buildNo: 6965

            Verified all test case in the ticket.

            dleeyh Daniel Lee (Inactive) added a comment - Build verified: engine: 4d4e4ad30dd2ec494ea9d323e1fa7fa69e97243e server: 1916028f898cf672a8b79d2b585b1d74f8bcd7db buildNo: 6965 Verified all test case in the ticket.

            People

              tntnatbry Gagan Goel (Inactive)
              allen.herrera Allen Herrera
              Daniel Lee Daniel Lee (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              4 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.