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


##########
flink-table/flink-table-planner/src/main/java/org/apache/flink/table/planner/plan/nodes/exec/serde/CompiledPlanSerdeUtil.java:
##########
@@ -265,6 +277,47 @@ 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(
+            ObjectNode objectNode,
+            String fieldName,
+            Class<? extends T> type,
+            ObjectCodec codec,
+            DeserializationContext ctx)
+            throws IOException {
+        if (objectNode.hasNonNull(fieldName)) {
+            return deserializeList(objectNode, fieldName, type, codec, ctx);
+        }
+        return List.of();
+    }
+
+    static <K, V> Map<K, V> deserializeMapOrEmpty(

Review Comment:
   Hi @snuyanzin, no I did not have an example. Looking at the code I see you 
need map because of the options. I should have looked more closely.   



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