@StephanEwen thank you for feedback! From what I see, `KeyGroupRangeAssignment#assignToKeyGroup` is utility class. It has 36 usages in different classes: state backends, operators, and tests. `AbstractKeyedStateBackend#setCurrentKey`, which uses the utilty method has 296 usages.
I'm bit afraid that catching and testing NPE earlier in the chain requires a significant effort to rewrite everything without much benefit. As try/catch doesn't make code cleaner and adding the same error message will violate DRY principle. Also, determine if the key is null earlier in the chain without preconditions with try/catch might lead to false positives as there's another reason for child method throwing NPE. >From what I see `computeKeyGroupForKeyHash(key.hashCode(), maxParallelism);` >is the place where key group index calcluated and NPE is thrown in case key is >null. Would you agree that catching NPE in utility class and overriding with a >specific message is viable alternative? [ Full content available at: https://github.com/apache/flink/pull/6724 ] This message was relayed via gitbox.apache.org for [email protected]
