[
https://issues.apache.org/jira/browse/KYLIN-4879?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Xiaoxiang Yu reassigned KYLIN-4879:
-----------------------------------
Assignee: Yaqian Zhang
> The function of sql to remove comments is not perfect. In some cases, the sql
> query conditions used will be modified
> --------------------------------------------------------------------------------------------------------------------
>
> Key: KYLIN-4879
> URL: https://issues.apache.org/jira/browse/KYLIN-4879
> Project: Kylin
> Issue Type: Bug
> Components: Query Engine
> Affects Versions: v2.6.0
> Reporter: wangjie
> Assignee: Yaqian Zhang
> Priority: Critical
> Fix For: v3.1.2, v4.0.0-GA
>
>
> In the removeCommentInSql method of QueryUtil of the query module, if the
> single quote character of the user's sql contains – or /**/, the regular
> expression will rewrite the sql query condition.
> E.g:
> (1) When the single quotation mark contains --, line break
> {quote}String sql = "select count(*) from test_kylin_fact WHERE column_name
> ='--this is not comment'\n "+ "LIMIT 100 offset 0";
> {quote}
> After the removeCommentInSql method, it will become:
> {quote}select count(*) from test_kylin_fact WHERE column_name = 'LIMIT 100
> offset 0
> {quote}
> (2) Contain multiple lines of comments in single quotes
> {quote}String sql = "select count(*) from test_kylin_fact WHERE column_name
> ='/**--this *is not comment***/'";
> {quote}
> After the removeCommentInSql method, it will become:
> {quote}select count(*) from test_kylin_fact WHERE column_name =''
> {quote}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)