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


##########
core/src/main/java/org/apache/calcite/rex/RexInterpreter.java:
##########
@@ -339,6 +341,25 @@ private static Comparable coalesce(List<Comparable> 
values) {
     return N;
   }
 
+  private static Comparable trim(RexNode call, List<Comparable> values) {
+    if (containsNull(values)) {
+      return N;
+    }
+    NlsString trimType = (NlsString) values.get(0);
+    NlsString trimed = (NlsString) values.get(1);
+    NlsString trimString = (NlsString) values.get(2);
+    switch (trimType.getValue()) {
+    case "BOTH":
+      return trimString.trim(trimed.getValue());
+    case "LEADING":
+      return trimString.ltrim(trimed.getValue());
+    case "TAILING":

Review Comment:
   thanks,had fixed it and added the test cover it from line 373 in 
RexImplicationCheckerTest##testSimplifyIdempotentFunctions



-- 
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