[GitHub] [calcite] herunkang2018 commented on a diff in pull request #3389: [CALCITE-5935] Add CODE_POINTS_TO_BYTES function (enabled in BigQuery…

2023-09-01 Thread via GitHub


herunkang2018 commented on code in PR #3389:
URL: https://github.com/apache/calcite/pull/3389#discussion_r1313685502


##
site/_docs/reference.md:
##
@@ -2685,6 +2685,7 @@ BigQuery's type system uses confusingly different names 
for types and functions:
 | b | CEIL(value)| Similar to standard 
`CEIL(value)` except if *value* is an integer type, the return type is a double
 | m s | CHAR(integer)| Returns the character 
whose ASCII code is *integer* % 256, or null if *integer*  0
 | b o p | CHR(integer)   | Returns the character 
whose UTF-8 code is *integer*
+| b | CODE_POINTS_TO_BYTES(integers) | Converts *integers*, an 
array of integers between 0 and 255 inclusive, throws error if any element is 
out of range

Review Comment:
   Minor comment, could we add the target result type in doc, to make it more 
concise? Like "Converts *integers*, an array of integers between 0 and 255 
inclusive, to a binary string, throws error if any element is out of range"



-- 
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: commits-unsubscr...@calcite.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



[GitHub] [calcite] herunkang2018 commented on a diff in pull request #3389: [CALCITE-5935] Add CODE_POINTS_TO_BYTES function (enabled in BigQuery…

2023-09-01 Thread via GitHub


herunkang2018 commented on code in PR #3389:
URL: https://github.com/apache/calcite/pull/3389#discussion_r1313685502


##
site/_docs/reference.md:
##
@@ -2685,6 +2685,7 @@ BigQuery's type system uses confusingly different names 
for types and functions:
 | b | CEIL(value)| Similar to standard 
`CEIL(value)` except if *value* is an integer type, the return type is a double
 | m s | CHAR(integer)| Returns the character 
whose ASCII code is *integer* % 256, or null if *integer*  0
 | b o p | CHR(integer)   | Returns the character 
whose UTF-8 code is *integer*
+| b | CODE_POINTS_TO_BYTES(integers) | Converts *integers*, an 
array of integers between 0 and 255 inclusive, throws error if any element is 
out of range

Review Comment:
   Minor comment, could we add the target result type in doc? Like "Converts 
*integers*, an array of integers between 0 and 255 inclusive, to a binary 
string, throws error if any element is out of range"



-- 
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: commits-unsubscr...@calcite.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



[GitHub] [calcite] herunkang2018 commented on a diff in pull request #3389: [CALCITE-5935] Add CODE_POINTS_TO_BYTES function (enabled in BigQuery…

2023-08-26 Thread via GitHub


herunkang2018 commented on code in PR #3389:
URL: https://github.com/apache/calcite/pull/3389#discussion_r1306586106


##
core/src/main/java/org/apache/calcite/runtime/SqlFunctions.java:
##
@@ -929,6 +929,29 @@ public static String charFromUtf8(int n) {
 return String.valueOf(Character.toChars(n));
   }
 
+  /**
+   * SQL CODE_POINTS_TO_BYTES function.
+   */
+  public static @Nullable ByteString codePointsToBytes(List codePoints) {

Review Comment:
   Thanks for clarification, I got it.



-- 
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: commits-unsubscr...@calcite.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



[GitHub] [calcite] herunkang2018 commented on a diff in pull request #3389: [CALCITE-5935] Add CODE_POINTS_TO_BYTES function (enabled in BigQuery…

2023-08-25 Thread via GitHub


herunkang2018 commented on code in PR #3389:
URL: https://github.com/apache/calcite/pull/3389#discussion_r1305571505


##
core/src/main/java/org/apache/calcite/runtime/SqlFunctions.java:
##
@@ -929,6 +929,29 @@ public static String charFromUtf8(int n) {
 return String.valueOf(Character.toChars(n));
   }
 
+  /**
+   * SQL CODE_POINTS_TO_BYTES function.
+   */
+  public static @Nullable ByteString codePointsToBytes(List codePoints) {

Review Comment:
   I notice that operand type chceker is `ARRAY_OF_INTEGER`, so IMO in runtime, 
it always be array of integer as operand, and not necessary to add the check 
logic for long value.



-- 
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: commits-unsubscr...@calcite.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org