You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@drill.apache.org by "second88 (JIRA)" <ji...@apache.org> on 2017/10/17 07:27:00 UTC

[jira] [Created] (DRILL-5884) Encode dot characters and other special characters in identifiers

second88 created DRILL-5884:
-------------------------------

             Summary: Encode dot characters and other special characters in identifiers
                 Key: DRILL-5884
                 URL: https://issues.apache.org/jira/browse/DRILL-5884
             Project: Apache Drill
          Issue Type: Wish
          Components: Client - JDBC, Client - ODBC, Metadata, SQL Parser, Storage - JDBC
    Affects Versions: 1.10.0
         Environment: OS: Windows 7 32-bit
Reporting tools: Crystal Reports 2008, Crystal Reports 2016
            Reporter: second88


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:
{code:sql}
SELECT `A`.`ID`
FROM `dfs%2etmp`.`A` `A`
{code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)