JSqlParser
JSqlParser copied to clipboard
ParseException: Encountered unexpected token: "EXCHANGE"
sql
alter table total_issue_info exchange partition P0001 with table total_issue_info_tmp
Expected Behavior
the sql runs well on Navicat, I expect jsqlparser parses it also well
Actual Behavior
net.sf.jsqlparser.JSQLParserException at net.sf.jsqlparser.parser.CCJSqlParserUtil.parse(CCJSqlParserUtil.java:51) at net.sf.jsqlparser.parser.CCJSqlParserUtil.parse(CCJSqlParserUtil.java:40) at com.spy.service.situation.SituationHandler.handle(SituationHandler.java:654) Caused by: net.sf.jsqlparser.parser.ParseException: Encountered unexpected token: "exchange" <S_IDENTIFIER> at line 1, column 34.
Was expecting one of:
"ADD"
"ALGORITHM"
"ALTER"
"CHANGE"
"DROP"
"MODIFY"
at net.sf.jsqlparser.parser.CCJSqlParser.generateParseException(CCJSqlParser.java:22439)
System
- Database :5.7
- Java Version :1.8
- JSqlParser version:4.0
Confirmed,
the exchange partition ... with table ... clause of the alter table statement is not supported.
Oracle supports it: https://docs.oracle.com/database/121/VLDBG/GUID-09CE9F52-A5BE-4CFD-8164-867CAF96DDCF.htm
See UnsupportedStatements as explain in #1945 (unless you will sponsor or provide a specific implementation of this feature.)