I am trying to parse the SQL query which is having DATE as the identifier using Apache Calcite. DATE is a reserve word in calcite and due to this it is failing to parse the query with the below error:
Exception: org.apache.calcite.sql.parser.SqlParseException: Encountered "date =" at line 1, column 43. Was expecting one of: "CURSOR" ... "EXISTS" ... "NOT" ... "ROW" ...
Example SQL query - select col1, col2, col3 from table1 where date = '2023-03-20'
How can we parse this query using calcite?
If I add the back-tick around DATE column then it will parse but as per my requirement it is not feasible to update all the SQL queries as there can be other reserve words also.
Updated query which is getting parse- select col1, col2, col3 from table1 where date
= '2023-03-20'