macroguo-ghy commented on code in PR #3373:
URL: https://github.com/apache/calcite/pull/3373#discussion_r1297927200


##########
core/src/main/java/org/apache/calcite/runtime/SqlFunctions.java:
##########
@@ -816,6 +816,33 @@ public static String charFromUtf8(int n) {
     return String.valueOf(Character.toChars(n));
   }
 
+  /**
+   * SQL CODE_POINTS_TO_BYTES function.
+   */
+  public static @Nullable ByteString codePointsToBytes(@Nullable List 
codePoints) {
+    if (codePoints == null) {
+      return null;
+    }
+    int length = codePoints.size();
+    byte[] bytes = new byte[length];
+    for (int i = 0; i < length; i++) {
+      Object codePoint = codePoints.get(i);

Review Comment:
   because of `bytes[i] = (byte) cp;`, I need to know the index in the loop for 
byte array assignment. 



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