snuyanzin commented on code in PR #24156:
URL: https://github.com/apache/flink/pull/24156#discussion_r1477286758


##########
flink-table/flink-table-runtime/src/main/java/org/apache/flink/table/runtime/functions/SqlFunctionUtils.java:
##########
@@ -1174,6 +1174,148 @@ public static String toBase64(byte[] bytes) {
         return Base64.getEncoder().encodeToString(bytes);
     }
 
+    public static BinaryStringData jsonQuote(BinaryStringData input) {
+        if (input == null) {
+            return null;
+        }
+
+        StringBuilder result = new StringBuilder("\"");
+
+        String inputStr = input.toString();
+        for (int i = 0; i < inputStr.length(); ) {
+            int codePoint = inputStr.codePointAt(i);
+            int charCount = Character.charCount(codePoint);
+
+            switch (codePoint) {

Review Comment:
   Escape doesn't seem to follow JSON spec defined at [1]
   e.g. it says that `*`, `/` should be escaped and here it doesn't escape it
   
   [1] https://www.json.org/json-en.html



-- 
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: issues-unsubscr...@flink.apache.org

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

Reply via email to