Steve Carlin created CALCITE-7925:
-------------------------------------

             Summary: Proposal: Change RexSimplify::simplify* methods to 
"protected"
                 Key: CALCITE-7925
                 URL: https://issues.apache.org/jira/browse/CALCITE-7925
             Project: Calcite
          Issue Type: Improvement
            Reporter: Steve Carlin


I had to create a custom RexSimplify to deal with some difference that my 
database has with the way Calcite handles NULLs.

This all works fine since I am able to inherit most of the behavior of 
RexSimplify with very small custom changes.

I just came across a problem though. At this point, I'm not sure if it is a 
Calcite bug or if it's a behavior specific to my database.  I'll mention the 
specifics at the end, but that's irrelevant to the purpose of this Jira. 
Whether it's a bug or not, I think overrides on simplifications should be 
allowed and the methods should be extensible/overrideable.

I would like the ability to override specific implementation details on a 
specific operator.  In my case, I'd like to override

"simplifyLike(RexCall e, RexUnknownAs unknownAs)"

But I cannot due this due to it being private.  Can we change this to be 
"protected"?

---

To be specific about the problem I'm hitting:

In my LIKE clause, I have " s LIKE 'a\\%%' "   My database treats the first 
four characters  as the string "a" plus an escaped percentage sign.  The fifth 
"%" character is treated as a wildcard.

The simplifyLike behavior reduces all multiple wildcards into a single 
wildcard. So by "simplifying" the expression, I lose the wildcard character.



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to