buptljy commented on a change in pull request #10120: [FLINK-14646] Check 
non-null for key in KeyGroupStreamPartitioner
URL: https://github.com/apache/flink/pull/10120#discussion_r343958586
 
 

 ##########
 File path: 
flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/partitioner/KeyGroupStreamPartitioner.java
 ##########
 @@ -55,6 +55,7 @@ public int 
selectChannel(SerializationDelegate<StreamRecord<T>> record) {
                } catch (Exception e) {
                        throw new RuntimeException("Could not extract key from 
" + record.getInstance().getValue(), e);
                }
+               Preconditions.checkNotNull(key, "HASH key must not be null!");
 
 Review comment:
   I kind of misunderstood the sentence `Fields, parameters, and return types 
are always non-null, unless indicated otherwise` when I read Code Style Guide 
yesterday :). You're right, it'd be better to move the check into 
`KeyGroupRangeAssignment`.

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to