There are two kinds of keywords: reserved and non-reserved. A non-reserved keyword can be used as a keyword in the right context, and as an identifier elsewhere.
IF was reserved in SQL:92, SQL:99, SQL:2003 but is no longer reserved in SQL:2011 (see table in SqlParserTest). So you could add it to Calcite as a non-reserved keyword. > On Jun 15, 2016, at 8:11 AM, Vitalii Diravka <vitalii.dira...@gmail.com> > wrote: > > Hi all! > > I need to add a new keyword "IF" for sql parser. > How can I use one keyword for two purposes: as a part of "IF EXISTS" > statement and as a function name? > > Actually I added "IF" as a new keyword in FMPP configuration file which > allows to extend Calcite's SQL parser. > After this "IF" isn't considered as an IDENTIFIER and function name. > > > > Kind regards > Vitalii