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

ASF GitHub Bot commented on DRILL-3510:
---------------------------------------

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

    https://github.com/apache/drill/pull/520#discussion_r99823941
  
    --- Diff: 
exec/java-exec/src/main/java/org/apache/drill/exec/planner/sql/SqlConverter.java
 ---
    @@ -161,6 +161,19 @@ public SqlNode parse(String sql) {
           SqlParser parser = SqlParser.create(sql, parserConfig);
           return parser.parseStmt();
         } catch (SqlParseException e) {
    +
    +      // Attempt to use default back_tick quote character for identifiers, 
when QUOTING_IDENTIFIERS_CHARACTER
    --- End diff --
    
    Yes, it was desirable behaviour:
    
[DRILL-3510#comment_1](https://issues.apache.org/jira/browse/DRILL-3510?focusedCommentId=14645147&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-14645147)
    
[DRILL-3510#comment_2](https://issues.apache.org/jira/browse/DRILL-3510?focusedCommentId=14943769&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-14943769)
    Since calcite doesn't support parsing statement with two different 
characters the only way is this approach. But I agree that it isn't an elegant 
decision. Therefore I plan to make as you suggested - to return the appropriate 
error. 


> 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
(v6.3.15#6346)

Reply via email to