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


##########
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:
   this seem like a typo.
   which suggests that this case is not tested.
   Why is this function needed? I don't see how it's related to the issue at 
hand.



##########
core/src/test/java/org/apache/calcite/test/RexImplicationCheckerTest.java:
##########
@@ -360,6 +361,116 @@ public class RexImplicationCheckerTest {
         hasToString("2014"));
   }
 
+  /** Test case for

Review Comment:
   why are these functions in RexImplicationCheckerTest?
   



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