The ''calcite SQL Parser is a LL(k) parser that build a Sql tree (SqlNode)
The parserConfig parameters control the parse process.
For example:
To parse specific SQL, you probably need to create:
As shown in the getting_started, you can parse a SQL with the query planning utility
SqlNode sqlNode = planner.parse("select depts.name, count(emps.empid) from emps inner join depts on emps.deptno = depts.deptno group by depts.deptno, depts.name order by depts.name");
Directly with a SqlParser Object
// Parser config with no case sensitivity (TABLE is the same than table)
SqlParser.Config parserConfig = SqlParser.configBuilder()
.setCaseSensitive(false)
.build();
// Create
SqlParser parser = SqlParser.create(sql, parserConfig)
// Parse
SqlNode sqlNode = parser.parseStmt() // for a statement
SqlNode sqlNode = parser.parseQuery() // if you known that it's a query
...
See also the Prepare function of JDBC CalcitePrepareImpl#prepare2_ function