drill-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (DRILL-3510) Add ANSI_QUOTES option so that Drill's SQL Parser will recognize ANSI_SQL identifiers
Date Wed, 15 Mar 2017 19:48:41 GMT

    [ https://issues.apache.org/jira/browse/DRILL-3510?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15926838#comment-15926838

ASF GitHub Bot commented on DRILL-3510:

Github user laurentgo commented on a diff in the pull request:

    --- Diff: exec/jdbc/src/main/java/org/apache/drill/jdbc/impl/DrillDatabaseMetaDataImpl.java
    @@ -184,6 +184,17 @@ private ServerMeta getServerMeta() throws SQLException {
         return serverMeta;
    +  /**
    +   * The same as {@link DrillDatabaseMetaDataImpl#getServerMeta()} but updates server
metadata for the every call
    +   * @return server meta information
    +   * @throws SQLException for error when getting server meta
    +   */
    +  private ServerMeta getUpdatedServerMeta() throws SQLException {
    --- End diff --
    if you set quoting_identifier in the connection string, it's part of the session, and
metadata would return the correct value. But does it need to reflect it if user set it after
the connection is established and used? 
    Also, it seems the JDBC driver for SQLServer always return the default quoting: https://github.com/Microsoft/mssql-jdbc/blob/master/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerDatabaseMetaData.java#L836

> Add ANSI_QUOTES option so that Drill's SQL Parser will recognize ANSI_SQL identifiers

> --------------------------------------------------------------------------------------
>                 Key: DRILL-3510
>                 URL: https://issues.apache.org/jira/browse/DRILL-3510
>             Project: Apache Drill
>          Issue Type: Improvement
>          Components: SQL Parser
>            Reporter: Jinfeng Ni
>            Assignee: Vitalii Diravka
>              Labels: doc-impacting
>             Fix For: 1.10.0
>         Attachments: DRILL-3510.patch, DRILL-3510.patch
> Currently Drill's SQL parser uses backtick as identifier quotes, the same as what MySQL
does. However, this is different from ANSI SQL specification, where double quote is used as
identifier quotes.  
> MySQL has an option "ANSI_QUOTES", which could be switched on/off by user. Drill should
follow the same way, so that Drill users do not have to rewrite their existing queries, if
their queries use double quotes. 
> {code}
> SET sql_mode='ANSI_QUOTES';
> {code}

This message was sent by Atlassian JIRA

View raw message