dssysolyatin commented on code in PR #4542:
URL: https://github.com/apache/calcite/pull/4542#discussion_r2356200942


##########
testkit/src/main/java/org/apache/calcite/util/Smalls.java:
##########
@@ -1492,4 +1492,24 @@ public static ByteString eval(String s) {
       }
     }
   }
+
+  /** User-defined function with return type Character[]. */
+  public static class CharacterArrayFunction {
+    public static Character[] eval(String s) {
+      if (s == null) {
+        return null;
+      }
+      try {
+        Character[] characters = new Character[s.length()];
+        int index = 0;

Review Comment:
   Use simple for loop
   ```
   Character[] characters = new Character[s.length()];
   for (int i = 0; i < s.length(); i++) {
       characters[i] = s.charAt(i);
   }
   return characters;
   ```



##########
testkit/src/main/java/org/apache/calcite/util/Smalls.java:
##########
@@ -1492,4 +1492,24 @@ public static ByteString eval(String s) {
       }
     }
   }
+
+  /** User-defined function with return type Character[]. */
+  public static class CharacterArrayFunction {
+    public static Character[] eval(String s) {
+      if (s == null) {
+        return null;
+      }
+      try {

Review Comment:
   Why do we need a try-catch here? If we really need it, why does it return 
null instead of a meaningful error?



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