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

    https://github.com/apache/flink/pull/3127#discussion_r97355576
  
    --- Diff: 
flink-core/src/main/java/org/apache/flink/api/java/typeutils/TypeExtractor.java 
---
    @@ -1916,6 +1918,50 @@ 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) {
    +                   int arity =((Row) v).getArity();
    +                   Iterable<Row> rows = (Iterable<Row>) value;
    +                   List<TypeInformation<?>> typesInRow = new 
ArrayList<>(arity);
    +                   TypeInformation<?>[] temp = new 
TypeInformation<?>[arity];
    +                   Collections.addAll(typesInRow, temp);
    +
    +                   for (Row r: rows) {
    --- End diff --
    
    Missing space.


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