JSQLParser / JSqlParser

JSqlParser parses an SQL statement and translate it into a hierarchy of Java classes. The generated hierarchy can be navigated using the Visitor Pattern
https://github.com/JSQLParser/JSqlParser/wiki
Apache License 2.0
5.32k stars 1.34k forks source link

[BUG] JSQLParser 4.9 : Clickhouse : Encountered unexpected token: "SETTINGS" <S_IDENTIFIER> #2043

Closed ningObito closed 1 month ago

ningObito commented 2 months ago

Always check against the Latest SNAPSHOT of JSQLParser and the Syntax Diagram

Failing SQL Feature:

Caused by: net.sf.jsqlparser.parser.ParseException: Encountered unexpected token: "SETTINGS" at line 20, column 9.

Was expecting one of:

    "::"
    "["
    "^"
    <EOF>
    <ST_SEMICOLON>

    at java.util.concurrent.FutureTask.report(FutureTask.java:122)
    at java.util.concurrent.FutureTask.get(FutureTask.java:206)
    at net.sf.jsqlparser.parser.CCJSqlParserUtil.parseStatement(CCJSqlParserUtil.java:343)
    at net.sf.jsqlparser.parser.CCJSqlParserUtil.parse(CCJSqlParserUtil.java:123)
    at com.baomidou.mybatisplus.extension.parser.JsqlParserGlobal.lambda$static$1(JsqlParserGlobal.java:58)
    at com.baomidou.mybatisplus.extension.parser.JsqlParserGlobal.parse(JsqlParserGlobal.java:68)
    at com.baomidou.mybatisplus.extension.parser.JsqlParserSupport.parserSingle(JsqlParserSupport.java:48)
    ... 89 more
Caused by: net.sf.jsqlparser.parser.ParseException: Encountered unexpected token: "SETTINGS" <S_IDENTIFIER>
    at line 20, column 9.

Was expecting one of:

    "::"
    "["
    "^"
    <EOF>
    <ST_SEMICOLON>

    at net.sf.jsqlparser.parser.CCJSqlParser.generateParseException(CCJSqlParser.java:39603)
    at net.sf.jsqlparser.parser.CCJSqlParser.jj_consume_token(CCJSqlParser.java:39427)
    at net.sf.jsqlparser.parser.CCJSqlParser.Statement(CCJSqlParser.java:317)
    at net.sf.jsqlparser.parser.CCJSqlParserUtil$1.call(CCJSqlParserUtil.java:339)
    at net.sf.jsqlparser.parser.CCJSqlParserUtil$1.call(CCJSqlParserUtil.java:336)
    at java.util.concurrent.FutureTask.run$$$capture(FutureTask.java:266)
    at java.util.concurrent.FutureTask.run(FutureTask.java)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:750)

SQL Example:

Software Information:

Tips:

Please write in English and avoid Screenshots (as we can't copy and paste content from it). Try your example online with the latest JSQLParser and share the link in the error report. Do provide Links or References to the specific Grammar and Syntax you are trying to use.

manticore-projects commented 1 month ago

Greetings.

this ClickHouse specific syntax is unsupported and not SQL:2016 compliant and you would need to sponsor or provide an implementation for it.