You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@kylin.apache.org by "Rofi Yao (Jira)" <ji...@apache.org> on 2021/04/25 10:25:00 UTC

[jira] [Comment Edited] (KYLIN-4988) In SQL, '!=' replaced with '<>'

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

Rofi Yao edited comment on KYLIN-4988 at 4/25/21, 10:24 AM:
------------------------------------------------------------

SQL parsing and Calcite are beyond my reach. The simpler approach I take is to use a more rigorous regex `WHERE[^']*('[^']*'[^']*)*!=`. [~xxyu]


was (Author: rofi):
SQL parsing and Calcite are beyond my reach. The simpler approach I take is to use a more rigorous regex `

WHERE[^']*('[^']*'[^']*)*!=`. [~xxyu]

> In SQL, '!=' replaced with '<>'
> -------------------------------
>
>                 Key: KYLIN-4988
>                 URL: https://issues.apache.org/jira/browse/KYLIN-4988
>             Project: Kylin
>          Issue Type: Bug
>            Reporter: Rofi Yao
>            Priority: Minor
>
> org.apache.kylin.query.util.DefaultQueryTransformer
> Isn't that too crude?@[~shaofengshi] [~xxyu]
>  
> And the result is
> @Test
> public void nonEqualTransform() throws Exception {
>     DefaultQueryTransformer transformer = new DefaultQueryTransformer();
>     String sql1 = "select a from b where c = '!=' and d = 'sum(1)'";
>     String sql2 = transformer.transform(sql1, "", "");
>     System.out.println("sql1: " + sql1);
>     System.out.println("sql2: " + sql2);
> }
>  
> output:
> sql1: select a from b where c = '!=' and d = 'sum(1)'
> sql2: select a from b where c = ' <> ' and d = ' COUNT(1) '
>  
> It's not expected result!



--
This message was sent by Atlassian Jira
(v8.3.4#803005)