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

"The storage engine for the table doesn't support IDB-3009: Unknown column" for complex query with subquery and window functions in infinidb_vtable_mode = 0;

    XMLWordPrintable

Details

    Description

      With the following Columnstore table:

      MariaDB [test]> show create table tc\G
      *************************** 1. row ***************************
             Table: tc
      Create Table: CREATE TABLE `tc` (
        `id` int(11) NOT NULL,
        `cid` int(11) DEFAULT NULL,
        `d` datetime DEFAULT NULL,
        `c` decimal(12,4) DEFAULT NULL
      ) ENGINE=Columnstore DEFAULT CHARSET=latin1
      1 row in set (0,000 sec)
       
      MariaDB [test]> select count(*) from tc;
      +----------+
      | count(*) |
      +----------+
      |   131072 |
      +----------+
      1 row in set (0,029 sec)
      

      this query works in default infinidb_vtable_mode = 1; and in infinidb_vtable_mode = 2:

      MariaDB [test]> set infinidb_vtable_mode = 1;
      Query OK, 0 rows affected (0,000 sec)
       
      MariaDB [test]> select cust, week_d, mpp_sum , stddev(mpp_sum) over (partition by cust) as mpp_stdev , avg(mpp_sum) over (partition by cust) as mpp_mean , sum(mpp_sum) over (partition by cust) as glob_mpp_sum,  count(mpp_sum) over (partition by cust) as glob_mpp_count  from  (select distinct cid as cust,  week(d) as week_d , sum(c) over (partition by cid, week(d)) as mpp_sum  from tc  where year(d) = '2018') as inside;
      ...
      |  100 |     16 |  392103.7000 | 21.62676616 | 31.73315079 |    1650.1238 |             52 |
      +------+--------+--------------+-------------+-------------+--------------+----------------+
      5252 rows in set (0,718 sec)
      

      But fails with strange error in infinidb_vtable_mode = 0;

      MariaDB [test]> set infinidb_vtable_mode = 0;
      Query OK, 0 rows affected (0,000 sec)
       
      MariaDB [test]> select cust, week_d, mpp_sum , stddev(mpp_sum) over (partition by cust) as mpp_stdev , avg(mpp_sum) over (partition by cust) as mpp_mean , sum(mpp_sum) over (partition by cust) as glob_mpp_sum,  count(mpp_sum) over (partition by cust) as glob_mpp_count  from  (select distinct cid as cust,  week(d) as week_d , sum(c) over (partition by cid, week(d)) as mpp_sum  from tc  where year(d) = '2018') as inside;
      ERROR 1178 (42000): The storage engine for the table doesn't support IDB-3009: Unknown column '..week_d'.
      

      I think this is a bug.

      Attachments

        Activity

          People

            Unassigned Unassigned
            valerii Valerii Kravchuk
            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.