Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:

      Description

      We hope to get hive query from JdbcImplementor. But ti don't support it 100%.

      Below are some incompatible cases:

      1. "CAST" call for literal condition because the varchar size is different between liberal constant and column: CAST(`t`.`LSTG_FORMAT_NAME` AS CHAR(6)) = 'FP-GTC'

      2. "AS" clause in "FROM" clause: FROM (SELECT CAL_DT, LSTG_FORMAT_NAME, PRICE FROM TEST_KYLIN_FACT) AS t

      ==The input query==
      SELECT TEST_CAL_DT.QTR_BEG_DT, SUM(TEST_KYLIN_FACT.PRICE) AS GMV, COUNT AS TRANS_CNT
      FROM TEST_KYLIN_FACT
      INNER JOIN TEST_CAL_DT ON TEST_KYLIN_FACT.CAL_DT = TEST_CAL_DT.CAL_DT
      WHERE TEST_KYLIN_FACT.LSTG_FORMAT_NAME = 'FP-GTC' AND TEST_CAL_DT.WEEK_BEG_DT BETWEEN ASYMMETRIC '2013-05-01' AND '2013-08-01'
      GROUP BY TEST_CAL_DT.QTR_BEG_DT

      ==The generated query===
      SELECT QTR_BEG_DT, SUM(PRICE) AS GMV, COUNT AS TRANS_CNT
      FROM (SELECT QTR_BEG_DT, PRICE
      FROM (SELECT CAL_DT, LSTG_FORMAT_NAME, PRICE
      FROM TEST_KYLIN_FACT) AS t
      INNER JOIN (SELECT CAL_DT, QTR_BEG_DT, WEEK_BEG_DT
      FROM TEST_CAL_DT) AS t0 ON t.CAL_DT = t0.CAL_DT
      WHERE CAST(t.LSTG_FORMAT_NAME AS CHAR(6)) = 'FP-GTC' AND t0.WEEK_BEG_DT >= '2013-05-01' AND t0.WEEK_BEG_DT <= '2013-08-01') AS t2
      GROUP BY QTR_BEG_DT

      ---------------- Imported from GitHub ----------------
      Url: https://github.com/julianhyde/optiq/issues/136
      Created by: jiangxuchina
      Labels:
      Created at: Fri Feb 14 03:04:00 CET 2014
      State: closed

        Activity

        Hide
        github-import GitHub Import added a comment -

        [Date: Sat Feb 15 02:13:43 CET 2014, Author: julianhyde]

        I have fixed case 2 (will check in shortly).

        I can't reproduce case 1 against MySQL and hsqldb, Optiq's standard databases. Open another case if it is still an issue.

        Show
        github-import GitHub Import added a comment - [Date: Sat Feb 15 02:13:43 CET 2014, Author: julianhyde ] I have fixed case 2 (will check in shortly). I can't reproduce case 1 against MySQL and hsqldb, Optiq's standard databases. Open another case if it is still an issue.

          People

          • Assignee:
            Unassigned
            Reporter:
            github-import GitHub Import
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development