If you want to parse the sql in PostgreSQL dialect, there is no way to do that now. You need a new SqlConformance actually.
Shivraj Singh <[email protected]>于2020年2月13日 周四下午3:50写道: > Hi, I want to parse the query of PostgreSQL via Calcite and while I am > parsing the query using the calcite parser it gives me exception for system > keyword. > > This is the program: > This is the query : > " select system from my_table;" > > val parser:SqlParser = SqlParser.create(query) > parser.parseQuery() > > Exception I got. > org.apache.calcite.sql.parser.SqlParseException: Encountered "*system*" at > line 1, column 8. > Was expecting one of: > "ABS" ... > "ALL" ... > > And I also got exception for this scenario to : > query : > INSERT INTO my_table(id,system_state) > VALUES (?, ?::system_state_type) > > exception I got: > org.apache.calcite.sql.parser.SqlParseException: Encountered "*:*" at line. > Was expecting one of: > <EOF> > "EXCEPT" ... > > Please help me > 1. How to parse these queries? > 2. Can we parse query using PostgresqlSqlDialect, if yes then how. > > Thanks. > > *Shivraj Singh* > Software Consultant > Knoldus Inc. <http://www.knoldus.com> > +91-8800782123 > Canada - USA - India - Singapore > <https://in.linkedin.com/company/knoldus> <https://twitter.com/Knolspeak> > <https://www.facebook.com/KnoldusSoftware/> <https://blog.knoldus.com/> >
