I am trying to use Apache Calcite's SqlParser to get entity level lineage for my views written in Hive and Impala. However, the parser throws an exception for the following cases.
SELECT emp.1ab FROM emp -- Column name begins with numeric
org.apache.calcite.sql.parser.SqlParseException: Encountered ".1" at line 1, column 12.
Was expecting one of:
<EOF>
"AS" ...
SELECT PERIOD from emp -- column name is a key word (period)
Caused by: org.apache.calcite.sql.parser.impl.ParseException: Encountered "period from" at line 1, column 9.
Was expecting one of:
"ALL" ...
This is my SqlParser config.
SqlParser.Config config = SqlParser
.configBuilder()
.setConformance(SqlConformanceEnum.LENIENT)
.build();
Is there any other config setting available to customize the parser to suit my needs. All these queries are valid in Hive.