In SqlStdOperatorTable, LIKE, NOT_LIKE, SIMILAR_TO and NOT_SIMILAR_TO are all instances of SqlLikeOperator with different parameters. I think you can follow that model.
LIKE and SIMILAR are regexes that have different languages. You are adding another. Hopefully you can follow the same pattern. Your operator is only a “binary operator” as far as parsing is concerned. When it comes to validation, compilation, execution the concrete syntax is not relevant. So don’t give the parsing aspect too much weight in your design. Julian > On May 13, 2019, at 8:51 AM, Muhammad Gelbana <m.gelb...@gmail.com> wrote: > > The title must be very confusing but I couldn't come up with a better one. > > I'm trying to implement the PostgreSQL posix regex binary operator[1], the > operator can be case in-sensitive (~*), negated (!~), both (!~*) or simple > case sensitive (~). This can be implemented using a single method: > *posixRegex(String > op1, String op2, boolean isCaseSensitive, boolean isNegated)* > > I defined the implementor method in RexImpTable but I can't have the > generated code to call the signature I mentioned. It's always attempting to > call *posixRegex(String op1, String op2)* which doesn't exist. I'm not sure > what I need to do here. Would someone guide me here please ? > > [1] https://issues.apache.org/jira/browse/CALCITE-3063 > > Thanks, > Gelbana