GeezerVison is showing github.com — Exception parsing show statement · Issue #1702 · JSQLParser/JSqlParser
Exception parsing show statement #1702DescriptionI am trying to parse "show indexes from my_table" and it is throwing ParseException :
net.sf.jsqlparser.parser.ParseException: Encountered unexpected token: "from" "FROM"
at line 1, column 14.
Was expecting one of:
";"
<EOF>
at net.sf.jsqlparser.parser.CCJSqlParser.generateParseException(CCJSqlParser.java:31234)
at net.sf.jsqlparser.parser.CCJSqlParser.jj_consume_token(CCJSqlParser.java:31067)
at net.sf.jsqlparser.parser.CCJSqlParser.Statement(CCJSqlParser.java:163)
Activitymanticore-projects commented on Dec 26, 2022 Greetings.
Your syntax show indexes from my_table is not supported, since it does not apply to any SQL Standard or major RDBMS (as far as I know).
Supported syntax are shown here.
You may want to provide or sponsor an implementation of this unsupported feature.
Please don't cross-post though. jayant-kumar-yadav commented on Dec 26, 2022 ContributorAuthor More actions MySql family DBs support this so I thought it would be there. manticore-projects commented on Dec 26, 2022 Let me put it like this: We are mostly interested in parsing and understanding the actual logic of a SQL statement in order to find out about tables, columns, expressions, joins, where clauses etc.
Your statement does not yield any of such information (except maybe the table name). It is RDBMS specific syntax for analysis.
For that reason, it is not implemented yet. Nobody has had an interest so far, because its easier to just skip it.
However, you can provide a PR when this statement is important for you. jayant-kumar-yadav commented on Dec 28, 2022 ContributorAuthor More actions added a commit that references this issue on May 16, 2023This issue will close once commit daa56ed is merged into the 'master' branch.daa56ed manticore-projects commented on May 16, 2023 Solved via commit daa56ed with PR #1778
It does not make sense to implement all the various RDBMS specific syntax since the SHOW statement does not bear any value or interesting content. Although throwing exceptions is also annoying, so UnsupportedStatement is the way to go.
If you are really interested in the content of the UnsupportedStatement then please use Regular Expressions on it. manticore-projects commented on May 16, 2023 added a commit that references this issue on Jun 1, 2023This issue will close once commit 41b6fce is merged into the 'master' branch.41b6fce added a commit that references this issue on Jun 15, 2023This issue will close once commit a815f5f is merged into the 'master' branch.a815f5f added a commit that references this issue on Jun 27, 2023This issue will close once commit c79dfff is merged into the 'master' branch.c79dfff
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|