zhipeng93 commented on code in PR #229:
URL: https://github.com/apache/flink-ml/pull/229#discussion_r1161461542


##########
flink-ml-iteration/src/main/java/org/apache/flink/iteration/operator/OperatorUtils.java:
##########
@@ -104,6 +107,33 @@ public static StreamConfig createWrappedOperatorConfig(
             }
         }
 
+        StreamConfig.InputConfig[] inputs = wrapperConfig.getInputs(cl);
+        for (int i = 0; i < inputs.length; ++i) {
+            if (inputs[i] instanceof NetworkInputConfig) {
+                TypeSerializer<?> typeSerializerIn =
+                        ((NetworkInputConfig) inputs[i]).getTypeSerializer();
+                if (typeSerializerIn instanceof IterationRecordSerializer) {

Review Comment:
   It seems that `typeSerializerIn` and `typeSerializerOut` should always be 
`IterationRecordSerializer` for wrapped iteration operators if they are not 
null.
   
   Is there any case that this condition does not hold?



##########
flink-ml-iteration/src/main/java/org/apache/flink/iteration/operator/OperatorUtils.java:
##########
@@ -104,6 +107,33 @@ public static StreamConfig createWrappedOperatorConfig(
             }
         }
 
+        StreamConfig.InputConfig[] inputs = wrapperConfig.getInputs(cl);
+        for (int i = 0; i < inputs.length; ++i) {
+            if (inputs[i] instanceof NetworkInputConfig) {
+                TypeSerializer<?> typeSerializerIn =
+                        ((NetworkInputConfig) inputs[i]).getTypeSerializer();
+                if (typeSerializerIn instanceof IterationRecordSerializer) {
+                    wrappedConfig.setInputs(
+                            new NetworkInputConfig(
+                                    ((IterationRecordSerializer<?>) 
typeSerializerIn)
+                                            .getInnerSerializer(),
+                                    i));
+                }
+            }
+        }
+
+        TypeSerializer<?> typeSerializerOut = 
wrapperConfig.getTypeSerializerOut(cl);
+        if (typeSerializerOut instanceof IterationRecordSerializer) {
+            wrappedConfig.setTypeSerializerOut(
+                    ((IterationRecordSerializer<?>) 
typeSerializerOut).getInnerSerializer());
+        }
+
+        TypeSerializer<?> stateKeySerializer = 
wrapperConfig.getStateKeySerializer(cl);
+        if (stateKeySerializer instanceof IterationRecordSerializer) {
+            wrappedConfig.setTypeSerializerOut(

Review Comment:
   It should be `wrappedConfig.setStateKeySerializer(...)` here.



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