To add a new infix operator such as ILIKE you will need to extend the parser. 
It makes sense if you think about it — you will need to make ILIKE into a 
keyword (possibly reserved) otherwise the parser wouldn’t know whether ILIKE is 
supposed to be an identifier.

As you have discovered, Calcite’s operator table contains operators of various 
syntactic types - function, prefix, postfix, infix - but only operators with 
function syntax can be handled without changing the parser.

Creating your own variant of the parser is not too difficult — see 
https://issues.apache.org/jira/browse/PHOENIX-1706 for how we did it in Phoenix.

Julian


> On Dec 29, 2015, at 9:38 AM, Homer <[email protected]> wrote:
> 
> Hi,
> 
> I have been fiddling around with UDF functions in calcite and it all seems to 
> work as expected.
> 
> What I am wondering is there a way to add/extend operators in calcite?
> 
> Lets say I wanted to have a syntax similar to postgress for ILIKE (case 
> insensitive LIKE)
> 
> It appears I can create an operator for ILIKE but I do not seem to be able to 
> get it wired in a way that it works without bracketing.
> 
> Is it possible?  If so is there an example somewhere of something similar.
> 
> regards
> Homer

Reply via email to