Github user fhueske commented on a diff in the pull request:

    https://github.com/apache/flink/pull/572#discussion_r28697764
  
    --- Diff: 
flink-java/src/main/java/org/apache/flink/api/java/operators/Keys.java ---
    @@ -274,24 +274,31 @@ private static int 
countNestedElementsBefore(CompositeType<?> compositeType, int
                 * Create ExpressionKeys from String-expressions
                 */
                public ExpressionKeys(String[] expressionsIn, 
TypeInformation<T> type) {
    -                   if(!(type instanceof CompositeType<?>)) {
    -                           throw new IllegalArgumentException("Key 
expressions are only supported on POJO types and Tuples. "
    -                                           + "A type is considered a POJO 
if all its fields are public, or have both getters and setters defined");
    -                   }
    -                   CompositeType<T> cType = (CompositeType<T>) type;
    -                   
    -                   String[] expressions = removeDuplicates(expressionsIn);
    -                   if(expressionsIn.length != expressions.length) {
    -                           LOG.warn("The key expressions contained 
duplicates. They are now unique");
    -                   }
    -                   // extract the keys on their flat position
    -                   keyFields = new 
ArrayList<FlatFieldDescriptor>(expressions.length);
    -                   for (int i = 0; i < expressions.length; i++) {
    -                           List<FlatFieldDescriptor> keys = 
cType.getFlatFields(expressions[i]); // use separate list to do a size check
    -                           if(keys.size() == 0) {
    -                                   throw new 
IllegalArgumentException("Unable to extract key from expression 
'"+expressions[i]+"' on key "+cType);
    +                   if (type instanceof AtomicType) {
    --- End diff --
    
    can you add a `null` check for `expressionsIn`?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to