xuzifu666 commented on code in PR #4176:
URL: https://github.com/apache/calcite/pull/4176#discussion_r1938388005
##########
core/src/main/java/org/apache/calcite/runtime/SqlFunctions.java:
##########
@@ -330,6 +330,28 @@ private static String toBase64_(byte[] bytes) {
}
}
+ /** SQL BASE64(string) function for string. */
+ public static String base64(String string) {
+ return toBase64_(string.getBytes(UTF_8));
+ }
+
+ /** SQL BASE64(string) function for bytestring. */
+ public static String base64(ByteString byteString) {
+ byte[] bytes = byteString.getBytes();
+ return toBase64_(bytes);
+ }
+
+ /** SQL UNBASE64(string) function. */
+ public static @Nullable String unBase64(String base64) {
+ try {
+ base64 = FROM_BASE64_REGEXP.matcher(base64).replaceAll("");
+ //CHECKSTYLE: IGNORE 1
Review Comment:
Calcite can not support new String method,use this comment to suppress it.
Other place in Calcite also use 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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]