MonsterChenzhuo commented on code in PR #2251: URL: https://github.com/apache/incubator-paimon/pull/2251#discussion_r1384387079
########## paimon-core/src/main/java/org/apache/paimon/utils/JsonSerdeUtil.java: ########## @@ -219,6 +221,43 @@ public static <T> JsonNode toTree(T value) { return OBJECT_MAPPER_INSTANCE.valueToTree(value); } + /** + * Adds primary key fields to a JSON string. + * + * @param value The original JSON string. + * @param pkNames A list of primary key names to be added to the JSON string. + * @param pkNamesKey The key under which the primary key names will be added. + * @return The JSON string with the added primary key names. If the JSON string is not a valid + * JSON object, or if the list of primary key names is empty or null, the original JSON + * string will be returned. + * @throws RuntimeException If an error occurs while parsing the JSON string or adding the + * primary key names. + */ + public static String addPrimaryKeysToJson( + String value, List<String> pkNames, String pkNamesKey) { Review Comment: done. -- 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...@paimon.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org