You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@kylin.apache.org by "Shaofeng SHI (JIRA)" <ji...@apache.org> on 2017/11/29 01:20:00 UTC

[jira] [Commented] (KYLIN-3057) In some cases,query failed when sql with comments

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

Shaofeng SHI commented on KYLIN-3057:
-------------------------------------

Hi Jianhua, Calcite can parse the comments in a SQL, we don't need additional handing for that. You can try the SQL "select count(*) from KYLIN_SALES --comment" or "select count(*) from KYLIN_SALES /* comment */"

In the sample case you provided, please remove ";" or move it after the comment, that will work. 

> In some cases,query failed when sql with comments
> -------------------------------------------------
>
>                 Key: KYLIN-3057
>                 URL: https://issues.apache.org/jira/browse/KYLIN-3057
>             Project: Kylin
>          Issue Type: Bug
>          Components: Query Engine
>    Affects Versions: v2.3.0
>            Reporter: peng.jianhua
>            Assignee: peng.jianhua
>         Attachments: 0001-KYLIN-3057-In-some-cases-query-failed-when-sql-with-.patch, no_comments_sql.PNG, with_comments_sql.PNG
>
>
> no_comments_sql.PNG: select trans_id from kylin_sales; 
> with_comments_sql.PNG : select trans_id from kylin_sales;--comments 
> if the sql end with semicolon and there are some comments behind semicolon,we will meet the error
> the following is the result of with_comments_sql.PNG:
> Results
> Encountered ";" at line 1, column 33. Was expecting one of: <EOF> "ORDER" ... "LIMIT" ... "OFFSET" ... "FETCH" ... "NATURAL" ... "JOIN" ... "INNER" ... "LEFT" ... "RIGHT" ... "FULL" ... "CROSS" ... "," ... "OUTER" ... "EXTEND" ... "(" ... "MATCH_RECOGNIZE" ... "." ... "AS" ... <IDENTIFIER> ... <QUOTED_IDENTIFIER> ... <BACK_QUOTED_IDENTIFIER> ... <BRACKET_QUOTED_IDENTIFIER> ... <UNICODE_QUOTED_IDENTIFIER> ... "TABLESAMPLE" ... "WHERE" ... "GROUP" ... "HAVING" ... "WINDOW" ... "UNION" ... "INTERSECT" ... "EXCEPT" ... "MINUS" ..



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