ykisana commented on code in PR #29483:
URL: https://github.com/apache/flink/pull/29483#discussion_r4275743322


##########
flink-table/flink-table-runtime/src/main/java/org/apache/flink/table/runtime/functions/SqlJsonUtils.java:
##########
@@ -611,6 +614,26 @@ public static JsonValueContext jsonParse(String input) {
         return jsonValueExpression(input);
     }
 
+    /** Parses a JSON string into a {@link Variant}, throwing on malformed 
input. */
+    public static Variant parseJsonToVariant(StringData jsonStr, boolean 
allowDuplicateKeys) {
+        final byte[] bytes = jsonStr.toBytes();
+        try {
+            return BinaryVariantInternalBuilder.parseJson(bytes, 
allowDuplicateKeys);
+        } catch (Exception e) {

Review Comment:
   Assuming going from Throwable to Exception is intentional



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