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

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved: