Myasuka commented on a change in pull request #12033:
URL: https://github.com/apache/flink/pull/12033#discussion_r422479353



##########
File path: 
flink-runtime/src/main/java/org/apache/flink/runtime/state/heap/HeapMapState.java
##########
@@ -158,7 +159,7 @@ public boolean contains(UK userKey) {
        @Override
        public Iterator<Map.Entry<UK, UV>> iterator() {
                Map<UK, UV> userMap = stateTable.get(currentNamespace);
-               return userMap == null ? null : userMap.entrySet().iterator();
+               return userMap == null ? Collections.<UK, 
UV>emptyMap().entrySet().iterator() : userMap.entrySet().iterator();

Review comment:
       Besides walking around in `NullAwareMapIterator`, I think a discussion 
is worthwhile and launched a 
[thread](http://apache-flink-mailing-list-archive.1008284.n3.nabble.com/DISCUSS-Align-the-behavior-of-internal-return-result-of-MapState-entries-keys-values-and-iterator-td41269.html)
 to discuss this. Hope you could also take a look.




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

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to