paul8263 commented on a change in pull request #18405:
URL: https://github.com/apache/flink/pull/18405#discussion_r788434023



##########
File path: 
flink-streaming-java/src/main/java/org/apache/flink/streaming/api/operators/AbstractStreamOperator.java
##########
@@ -323,7 +323,9 @@ protected boolean isUsingCustomRawKeyedState() {
     public void open() throws Exception {}
 
     @Override
-    public void finish() throws Exception {}
+    public void finish() throws Exception {
+        setCurrentKey(EndOfDataKey.INSTANCE);

Review comment:
       Hi @dawidwys ,
   Actually if we set null as the key and run in streaming mode, we will get:
   `
   Caused by: java.lang.NullPointerException: Assigned key must not be null!
        at 
org.apache.flink.util.Preconditions.checkNotNull(Preconditions.java:76)
        at 
org.apache.flink.runtime.state.KeyGroupRangeAssignment.assignToKeyGroup(KeyGroupRangeAssignment.java:64)
        at 
org.apache.flink.runtime.state.AbstractKeyedStateBackend.setCurrentKey(AbstractKeyedStateBackend.java:191)
        at 
org.apache.flink.streaming.api.operators.StreamOperatorStateHandler.setCurrentKey(StreamOperatorStateHandler.java:362)
        ... 22 more
   `
   




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