I wrote a simple script that just goes through all the keywords one by one
and tries them (by running the Babel test suite). Interestingly, YEAR did
not work based on this test, but YEARS did. All I did was try adding things
to both keywords and nonReservedKeywords.

--
Michael Mior
mm...@apache.org


Le ven. 31 août 2018 à 19:19, Julian Hyde <jh...@apache.org> a écrit :

> As you may now, we have a ‘Babel’ SQL parser whose mission is to accept
> SQL of the widest possible set of SQL dialects.
>
> One of the things we can improve is to take reserved keywords and make
> them not reserved. They would then have a meaning if used in a specific
> context, but could otherwise be used as identifiers (table names, column
> names, aliases) without being quoted.
>
> I tried making “YEAR” non-reserved, and the experiment was successful.
> However I tried making everything non-reserved, adding all of the reserved
> keywords[1] to the non-reserved list in Babel[2]. But it didn’t work too
> well.
>
> Can anyone devise a way to figure out the minimal set of reserved keywords?
>
> Julian
>
> [1]
> https://github.com/apache/calcite/blob/master/core/src/test/java/org/apache/calcite/sql/parser/SqlParserTest.java#L94
> <
> https://github.com/apache/calcite/blob/master/core/src/test/java/org/apache/calcite/sql/parser/SqlParserTest.java#L94
> >
>
> [2]
> https://github.com/apache/calcite/blob/master/babel/src/main/codegen/config.fmpp#L32
> <
> https://github.com/apache/calcite/blob/master/babel/src/main/codegen/config.fmpp#L32>
>

Reply via email to