Adding "IF" to a non-reserved keywords list can resolve that issue.
But I saw that in Parser.jj SQL:2003 is used. Also I found "IF" keyword as a reserved word in ISO/IEC 9075-4 (Fourth edition 2011-12-15). So what standard actually calcite uses? Can we add anyway "IF" to the non-reserved keywords list? Kind regards Vitalii 2016-06-15 18:07 GMT+00:00 Julian Hyde <jh...@apache.org>: > 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 > >