xuzifu666 commented on code in PR #4460:
URL: https://github.com/apache/calcite/pull/4460#discussion_r2191891761


##########
core/src/main/java/org/apache/calcite/rex/RexSimplify.java:
##########
@@ -511,6 +512,15 @@ private RexNode simplifyLike(RexCall e, RexUnknownAs 
unknownAs) {
     return simplifyGenericNode(e);
   }
 
+  private boolean withSameChar(String str, Character c) {
+    for (Character character : str.toCharArray()) {

Review Comment:
   Thank for suggestion! @julianhyde , this is more concise, but I made some 
changes based on this and submitted them:
   1. String cannot be directly ```replacedAll()``` here, otherwise the 
checkframe work will fail, so I changed it to regex replacement;
   2. This modification is not compatible with other parameters, such as escape 
characters, I made relevant modifications to support it;
   3. The generated new RexCall cannot be directly specified as 
```SqlStdOperatorTable.LIKE```, because other tests such as ```ILike``` will 
also come here, so it is replaced with ```e.getOperator()```.
   Others are fine after testing.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to