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

    https://github.com/apache/flink/pull/3127#discussion_r96414774
  
    --- Diff: 
flink-core/src/main/java/org/apache/flink/api/java/typeutils/TypeExtractor.java 
---
    @@ -1916,6 +1918,46 @@ else if (value instanceof Row) {
                }
        }
     
    +   public static <X> TypeInformation<X> getForCollection(Iterable<X> 
value) {
    +           return new TypeExtractor().privateGetForIterable(value);
    +   }
    +
    +   public static <X> TypeInformation<X> getForCollection(X[] value) {
    +           return new 
TypeExtractor().privateGetForIterable(Arrays.asList(value));
    +   }
    +
    +   @SuppressWarnings({ "unchecked", "rawtypes" })
    +   private <X> TypeInformation<X> privateGetForIterable(Iterable<X> value) 
{
    +           checkNotNull(value);
    +
    +           Iterator<X> it = value.iterator();
    +           X v = checkNotNull(it.next());
    +
    +           if (v instanceof Row) {
    --- End diff --
    
    So this only works if there is one `Row` for which every field is not null? 
Why not instead search the type of every column separately, and then create the 
`RowTypeInfo` manually? Then it would only fail if one field is null for every 
`Row`.


---
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 [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to