Toni Mueller created CALCITE-4751:
-------------------------------------

             Summary: SqlParserImpl.FACTORY does not support infix cast 
operator ('10'::INT)
                 Key: CALCITE-4751
                 URL: https://issues.apache.org/jira/browse/CALCITE-4751
             Project: Calcite
          Issue Type: Bug
            Reporter: Toni Mueller


Since I'm struggling with 
[CALCITE-4746|https://issues.apache.org/jira/browse/CALCITE-4746] I tried to 
use the SqlBabelParserImpl.FACTORY instead. Which works fine but then I found 
another problem.

It seems that there is no support for the Postgres Infix Cast operator in this 
ParserImplementation? So trying to run:

{code:java}
        SqlParser.Config c = SqlParser.config()
                .withParserFactory(SqlParserImpl.FACTORY);
        SqlParser parser = SqlParser.create("SELECT bar::INT FROM foo", c);
        parser.parseQuery();
{code}

gives 

{code:java}
org.apache.calcite.sql.parser.SqlParseException: Encountered ":" at line 1, 
column 13.
Was expecting one of:
    <EOF> 
    "AS" ...
    "EXCEPT" ...
    "FETCH" ...
    "FROM" ...
    "INTERSECT" ...
    "LIMIT" ...
    "OFFSET" ...
    "ORDER" ...
    "MINUS" ...
    "UNION" ...
    <QUOTED_STRING> ...
    "," ...
    <BRACKET_QUOTED_IDENTIFIER> ...
    <QUOTED_IDENTIFIER> ...
    <BACK_QUOTED_IDENTIFIER> ...
    <HYPHENATED_IDENTIFIER> ...
    <IDENTIFIER> ...
    <UNICODE_QUOTED_IDENTIFIER> ...
    "." ...
    "NOT" ...
    "IN" ...
    "<" ...
    "<=" ...
    ">" ...
    ">=" ...
    "=" ...
    "<>" ...
    "!=" ...
    "BETWEEN" ...
    "LIKE" ...
    "SIMILAR" ...
    "+" ...
    "-" ...
    "*" ...
    "/" ...
    "%" ...
    "||" ...
    "AND" ...
    "OR" ...
    "IS" ...
    "MEMBER" ...
    "SUBMULTISET" ...
    "CONTAINS" ...
    "OVERLAPS" ...
    "EQUALS" ...
    "PRECEDES" ...
    "SUCCEEDS" ...
    "MULTISET" ...
    "[" ...
    "(" ...
{code}

Is this intentional or is this a bug?



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

Reply via email to