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

Make calcite case handling and quoting method more configurable.

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • v2.5.0
    • Query Engine
    • None

    Description

      >> Do you know whether Calcite supports that? If Calcite already supports it with some parameter, Kylin can expose that as a configuration. Yes, Calcite support to customize some sql handle feature by connection properties. We can customize it by provide an Properties when use jdbc's DriverManager.getConnection(url, extraProperties). Here is my commit (with UT) to achieve this https://github.com/ian4hu/kylin/commit/88ee638fb4c8b55b089294107ad361ec3fc6dae9  For short lookup see QueryConnection.getConnection(project)@ https://github.com/apache/kylin/blob/25b300c1f654561e561565ebf35c4e0e93ae0a04/query/src/main/java/org/apache/kylin/query/QueryConnection.java#L51  the key is the info variable.

       

      Background (from mailing list http://mail-archives.apache.org/mod_mbox/kylin-dev//201807.mbox/%3C4247fe2a.634d.164e995a707.Coremail.hu2008yinxiang%40163.com%3E ):

      We use kylin in our BI system as a sub-query engine. we met some problems in our use case like bellow.

      1. Our visual design tool use source table schema as metadata, and the source table column is lower case or mixed case, and visual tool generate SQL for kylin query.
      2. Kylin execute sql and return result
      3. we use a parser to parse result and assembly it to entities (like ORM engine did)

      but the problem is that kylin now always casting the column to UPPER case, that break our parser and whe can not change that behavior by configure kylin. like "select 1 as value_ALIAS" we always get the column named "VALUE_ALIAS" instead of "value_ALIAS" from Kylin.

       

      although we can use 'select 1 as "value_ALIAS"' (with double-qouted alias) and it will be better if we can configure the quoting method.

       

      I would like contribute features to make the query engine is more flexible

      1. First of all, make the case handling and quoting method is configurable by kylin.properties, that a global configuration.
      2. Second make case handling and quoting method available by JDBC connection url parameters or connection properties by DriverManager.getConnection(url-with-parameters, extra-properties)

       

      Attachments

        Issue Links

          Activity

            People

              hu2008yinxiang Ian Hu
              hu2008yinxiang Ian Hu
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: