snuyanzin commented on PR #24967:
URL: https://github.com/apache/flink/pull/24967#issuecomment-2208332293

   Thanks for the contribution @anupamaggarwal 
   I checked for most cases it works well
   
   I found one issue with symbols encoded outside of [BMP 
](https://en.wikipedia.org/wiki/Plane_(Unicode)#Basic_Multilingual_Plane) 
   
   e.g.
   ```sql
   SELECT '≠';
   ```
   This works fine
   now if we try it with newly added functions
   ```sql
   SELECT json_quote('≠');
   ```
   
   it fails as
   ```
   Caused by: java.util.IllegalFormatConversionException: x != 
java.lang.Character
        at 
java.base/java.util.Formatter$FormatSpecifier.failConversion(Formatter.java:4426)
        at 
java.base/java.util.Formatter$FormatSpecifier.printInteger(Formatter.java:2938)
        at 
java.base/java.util.Formatter$FormatSpecifier.print(Formatter.java:2892)
        at java.base/java.util.Formatter.format(Formatter.java:2673)
        at java.base/java.util.Formatter.format(Formatter.java:2609)
        at java.base/java.lang.String.format(String.java:2897)
        at 
org.apache.flink.table.runtime.functions.scalar.JsonQuoteFunction.formatStr(JsonQuoteFunction.java:77)
        at 
org.apache.flink.table.runtime.functions.scalar.JsonQuoteFunction.quote(JsonQuoteFunction.java:68)
        at 
org.apache.flink.table.runtime.functions.scalar.JsonQuoteFunction.eval(JsonQuoteFunction.java:88)
        at StreamExecCalc$3.processElement(Unknown Source)
        at 
org.apache.flink.streaming.runtime.tasks.CopyingChainingOutput.pushToOperator(CopyingChainingOutput.java:75)
        at 
org.apache.flink.streaming.runtime.tasks.CopyingChainingOutput.collect(CopyingChainingOutput.java:50)
        at 
org.apache.flink.streaming.runtime.tasks.CopyingChainingOutput.collect(CopyingChainingOutput.java:29)
        at ...
   ```
   
   I tend to think that here
   ```
        at 
org.apache.flink.table.runtime.functions.scalar.JsonQuoteFunction.formatStr(JsonQuoteFunction.java:77)
        at 
org.apache.flink.table.runtime.functions.scalar.JsonQuoteFunction.quote(JsonQuoteFunction.java:68)
        at 
org.apache.flink.table.runtime.functions.scalar.JsonQuoteFunction.eval(JsonQuoteFunction.java:88)
   ```
   need to work with codepoints rather than chars
   
   
   I also checked same query for MySQL and it works perfectly fine      


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