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


##########
flink-table/flink-table-planner/src/main/java/org/apache/flink/table/planner/plan/nodes/exec/serde/CompiledPlanSerdeUtil.java:
##########
@@ -265,6 +277,49 @@ static <T> Optional<T> deserializeOptionalField(
         return Optional.empty();
     }
 
+    static <T> List<T> deserializeList(
+            ObjectNode objectNode,
+            String fieldName,
+            Class<? extends T> type,
+            ObjectCodec codec,
+            DeserializationContext ctx)
+            throws IOException {
+        return ctx.readValue(
+                traverse(objectNode.required(fieldName), codec),
+                ctx.getTypeFactory().constructCollectionType(List.class, 
type));
+    }
+
+    static <T> List<T> deserializeListOrEmpty(

Review Comment:
   Can you elaborate your question a bit ?
   Here it is an example of `deserializeList` usage (will fail if not present 
in json)
   
https://github.com/apache/flink/pull/26683/files#diff-171890929b0275d27a8be97b4fd44f99d6910ce6649d1267c196b1285ced9ff3R65
   example of `deserializeListOrEmpty` (will be considered as empty if not 
present in json)
   
https://github.com/apache/flink/pull/26683/files#diff-2f804b8ba94aa78460f122f44d050cd10af9386c78b9cd08edac79f4ef4fb00fR73
   
   and example of `deserializeMapOrEmpty`
   
https://github.com/apache/flink/pull/26683/files#diff-3ce02724af75d34b80c98d3c52c33b6f88a81c0536beb6dd45e9a05a57abc1eeR73



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