**Describe the bug** A query with SAFE_CAST function used in it could not be parsed. **To Reproduce** Steps to reproduce the behavior: 1. Example query ([reference](https://cloud.google.com/bigquery/docs/reference/standard-sql/functions-and-operators) ```sql SELECT SAFE_CAST("apple" AS INT64) AS not_a_number; ``` 2. Parsing using JSqlParser ```java try { Statement safeCastSt = CCJSqlParserUtil.parse("SELECT SAFE_CAST(\"apple\" AS INT64) AS not_a_number"); } catch (JSQLParserException e) { e.printStackTrace(); } ``` 3. 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
Activity
manticore-projects commentedon Nov 22, 2022
Fixed by #1634, works with JSQLParser 4.6 Snapshot.