Closed
Description
Describe the bug
A query with SAFE_CAST function used in it could not be parsed.
To Reproduce
Steps to reproduce the behavior:
- Example query (reference
SELECT SAFE_CAST("apple" AS INT64) AS not_a_number;
- Parsing using JSqlParser
try { Statement safeCastSt = CCJSqlParserUtil.parse("SELECT SAFE_CAST(\"apple\" AS INT64) AS not_a_number"); } catch (JSQLParserException e) { e.printStackTrace(); }
- Exception thrown
net.sf.jsqlparser.JSQLParserException
at net.sf.jsqlparser.parser.CCJSqlParserUtil.parse(CCJSqlParserUtil.java:51)
...
<snipped>
...
Caused by: net.sf.jsqlparser.parser.ParseException: Encountered unexpected token: "(" "("
at line 1, column 17.
Was expecting one of:
"&"
","
"::"
";"
"<<"
">>"
"ACTION"
...
Expected behavior
The query would parse successfully.
System
- Java Version: 11.0.3
- JSqlParser version: 3.0
Metadata
Metadata
Assignees
Labels
No labels