You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@calcite.apache.org by "chener (Jira)" <ji...@apache.org> on 2021/01/19 08:05:00 UTC

[jira] [Created] (CALCITE-4472) the SqlParserPos in like statement and in limit statement seems wrong

chener created CALCITE-4472:
-------------------------------

             Summary: the SqlParserPos in like statement and in limit statement seems wrong
                 Key: CALCITE-4472
                 URL: https://issues.apache.org/jira/browse/CALCITE-4472
             Project: Calcite
          Issue Type: Bug
          Components: core
    Affects Versions: 1.21.0
         Environment: java8 + idea + maven3 

calcite version: 1.21.0
            Reporter: chener
         Attachments: image-2021-01-19-15-54-38-621.png, image-2021-01-19-16-00-20-059.png

Here are the sqls:

 
{code:java}
// like statement
select id,name from chener where name like 'name'

//limit statement
select id,name from chener where name = 'jack' limit 1

{code}
than the parser code:
{code:java}
// the java code for parser
SqlParser.Config mysqlConfig = SqlParser.configBuilder()
        .setParserFactory(SqlAlterParserImpl.FACTORY)
        .setLex(Lex.MYSQL)
        .build();
SqlParser parser = SqlParser.create("", mysqlConfig);
SqlNode sqlNode = parser.parseQuery(likeSql);
SqlNode sqlNode1 = parser.parseQuery(limitSql);

{code}
the like statement result:

!image-2021-01-19-15-54-38-621.png!

You can see that the SqlParserPos of the like statement in where seems wrong.If the where statement does not contain the like statement,it works allright. And so does the limit stament.

!image-2021-01-19-16-00-20-059.png!

 

 



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