Uploaded image for project: 'Apache Drill'
  1. Apache Drill
  2. DRILL-5884

Encode dot characters and other special characters in identifiers

    XMLWordPrintableJSON

    Details

    • Type: Wish
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 1.10.0
    • Fix Version/s: None
    • Labels:
      None
    • Environment:

      OS: Windows 7 32-bit
      Reporting tools: Crystal Reports 2008, Crystal Reports 2016

      Description

      Crystal Reports 2008 & 2016 do not work for generic JDBC / ODBC drivers (including Drill) if there are dot characters in identifiers such as schema names.
      For example, given that there exists a view called `dfs.tmp`.`A`, it is not listed under schema `dfs.tmp` in the report creation wizard of Crystal Reports 2008 / 2016.
      It is because Crystal Reports chops schema name from "dfs.tmp" to "tmp" due the dot character and then tries to retrieve the table names under the non-existing schema "tmp" using the metadata API of JDBC / ODBC.

      I suggest to add an optional parameter called "url_encodes_id" to the connection string where the default value is false.
      When url_encodes_id=true, the JDBC / ODBC driver or the SQL parser on the server side provides URL-encoded metadata information such as schema names and table names and URL-decodes the identifiers before it actually execute the metadata API or SQL statements.
      For example, the following methods of DatabaseMetaData takes URL-encoded IDs / patterns and return URL-encoded IDs:
      getSchemas()
      getSchemas(String catalog, String schemaPattern)
      getTables(String catalog, String schemaPattern, String tableNamePattern, String types[])

      And the following select statement, of which the schema name is URL-encoded, will be able to execute by JDBC / ODBC driver:

      SELECT `A`.`ID`
      FROM `dfs%2etmp`.`A` `A`
      

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              second88 second88
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: