Uploaded image for project: 'Kylin'
  1. Kylin
  2. KYLIN-347

Query planner somehow doesn't recognize table name in lower case

    XMLWordPrintableJSON

Details

    Description

      Tried to run below SQL, failed with no detail reason on web UI. Found the reason from Tomcat log:

      ```
      SQL: select lstg_format_name, week_beg_dt, meta_categ_name, sum(price) as price
      from test_kylin_fact as fact
      inner join test_category_groupings as cat on cat.leaf_categ_id = fact.leaf_categ_id
      and cat.site_id = fact.lstg_site_id
      inner join test_cal_dt as cal on cal.cal_dt = fact.cal_dt
      where week_beg_dt >= date'2013-01-01' and week_beg_dt <= date'2013-05-01'
      group by week_beg_dt, cat.meta_categ_name, lstg_format_name
      order by week_beg_dt
      User: ADMIN
      Success: false
      Duration: 0.002
      Project: onlyinner
      Cube Names: []
      Cuboid Ids: []
      Total scan count: 0
      Result row count: 0
      Accept Partial: true
      Hit Cache: true
      Message: error while executing SQL "select lstg_format_name, week_beg_dt, meta_categ_name, sum(price) as price
      from test_kylin_fact as fact
      inner join test_category_groupings as cat on cat.leaf_categ_id = fact.leaf_categ_id
      and cat.site_id = fact.lstg_site_id
      inner join test_cal_dt as cal on cal.cal_dt = fact.cal_dt
      where week_beg_dt >= date'2013-01-01' and week_beg_dt <= date'2013-05-01'
      group by week_beg_dt, cat.meta_categ_name, lstg_format_name
      order by week_beg_dt LIMIT 50000": From line 3, column 12 to line 3, column 34: Table 'TEST_CATEGORY_GROUPINGS' not found
      ```

      Then, tried to use the exact table name (in upper case) rerun the SQL and succeed.

      ```
      SQL: select lstg_format_name, week_beg_dt, meta_categ_name, sum(price) as price
      from test_kylin_fact as fact
      inner join TEST_CATEGORY_GROUPINGS as cat on cat.leaf_categ_id = fact.leaf_categ_id
      and cat.site_id = fact.lstg_site_id
      inner join test_cal_dt as cal on cal.cal_dt = fact.cal_dt
      where week_beg_dt >= date'2013-01-01' and week_beg_dt <= date'2013-05-01'
      group by week_beg_dt, cat.meta_categ_name, lstg_format_name
      order by week_beg_dt
      User: ADMIN
      Success: true
      Duration: 0.997
      Project: onlyinner
      Cube Names: [test_kylin_cube_with_slr_empty]
      Cuboid Ids: [423]
      Total scan count: 0
      Result row count: 0
      Accept Partial: true
      Hit Cache: false
      Message: null
      ```

      Tried the simplest SQL to validate if the table name in lower case is valid, the answer is true.

      ```
      SQL: select * from test_category_groupings
      User: ADMIN
      Success: true
      Duration: 0.052
      Project: onlyinner
      Cube Names: [test_kylin_cube_with_slr_empty]
      Cuboid Ids: []
      Total scan count: 0
      Result row count: 144
      Accept Partial: true
      Hit Cache: false
      Message: null
      ```

      So, why the first SQL failed with table not found?

      ---------------- Imported from GitHub ----------------
      Url: https://github.com/KylinOLAP/Kylin/issues/158
      Created by: branky
      Labels:
      Created at: Wed Dec 03 08:21:17 CST 2014
      State: open

      Attachments

        Activity

          People

            mahongbin Hongbin Ma
            lukehan Luke Han
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: