Github user sihuazhou commented on a diff in the pull request: https://github.com/apache/flink/pull/5735#discussion_r176099684 --- Diff: flink-core/src/main/java/org/apache/flink/api/common/state/FoldingStateDescriptor.java --- @@ -89,7 +89,7 @@ public FoldingStateDescriptor(String name, ACC initialValue, FoldFunction<T, ACC * @param typeSerializer The type serializer of the values in the state. */ public FoldingStateDescriptor(String name, ACC initialValue, FoldFunction<T, ACC> foldFunction, TypeSerializer<ACC> typeSerializer) { - super(name, typeSerializer, initialValue); + super(name, typeSerializer, DefaultValueFactory.create(typeSerializer, requireNonNull(initialValue))); this.foldFunction = requireNonNull(foldFunction); --- End diff -- same as above.
---