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

ColumnStore is limited to two columns in a GROUP BY statement.

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • None
    • 1.0.2
    • ExeMgr
    • None
    • 1.0.2-2

    Description

      Reported by an alpha customer:

      Today’s issue, is that my developer is having some issues with GROUP BY statements, and seems to think that ColumnStore is limited to two columns in a GROUP BY statement. The documentation suggests that there’s a 10-column maximum on this page https://mariadb.com/kb/en/mariadb/columnstore-select/

      I get this error:
      Internal error: IDB-2021: 'gbd.output_cod_single_year_v265.sex_id' 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.

      For the following select statement.

      SELECT
      measure_id,
      location_id,
      sex_id,
      age_group_id,
      cause_id,
      metric_id,
      MIN(val) AS min,
      MAX(val) AS max,
      MIN(lower) AS min_ui,
      MAX(upper) AS max_ui
      FROM output_cod_single_year_v265
      WHERE measure_id IN(1)
      AND metric_id IN(3)
      AND cause_id IN(294)
      AND year_id IN(
      1980,1981,1982,1983,1984,1985,1986,1987,1988,1989,
      1990,1991,1992,1993,1994,1995,1996,1997,1998,1999,
      2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,
      2010,2011,2012,2013,2014,2015
      )
      AND location_id IN(
      184,183,182,185,187,191,180,181,435,186,189,190,198,179,178,177,176,175,173,172,204,215,170,171,202,169,168,148,147,522,154,139,195,197,194,196,193,218,217,216,214,213,212,211,210,209,206,208,207,203,205,201,200,110,111,105,109,112,115,119,106,116,117,107,114,385,422,132,127,131,130,129,128,126,108,102,349,305,125,113,122,136,118,99,133,123,98,135,121,97,40,41,39,37,36,38,8,68,7,67,6,15,10,20,12,13,18,66,16,11,69,19,14,164,165,142,17,162,161,160,150,145,149,146,151,152,155,157,143,144,153,85,35,77,140,34,33,156,61,48,51,52,63,57,47,62,54,45,90,93,60,59,84,83,95,79,58,78,49,50,46,88,55,82,86,91,53,92,44,74,43,89,87,80,81,94,76,75,72,71,26,30,28,22,351,376,24,25,23,27,29,298,101,141,163
      )
      AND sex_id IN(3)
      AND age_group_id IN(22)
      GROUP BY measure_id, location_id, sex_id, age_group_id, cause_id, metric_id

      This is somewhat of a showstopper for us, if this is a bug (which I suspect it might be).

      The table schema is as follows:

      CREATE TABLE `output_cod_single_year_v265` (
      `measure_id` int(11) NOT NULL,
      `year_id` int(11) NOT NULL,
      `location_id` int(11) NOT NULL,
      `sex_id` int(11) NOT NULL,
      `age_group_id` int(11) NOT NULL,
      `cause_id` int(11) NOT NULL,
      `metric_id` int(11) NOT NULL,
      `val` double NOT NULL,
      `upper` double DEFAULT NULL,
      `lower` double DEFAULT NULL
      ) ENGINE=Columnstore

      Attachments

        Activity

          People

            dleeyh Daniel Lee (Inactive)
            hill David Hill (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.