Skip to content

Commit

Permalink
[hotfix] [types] Expose type extraction error for fromElements/Collec…
Browse files Browse the repository at this point in the history
…tion()

This closes apache#6036.
  • Loading branch information
twalthr committed May 22, 2018
1 parent 1c5a929 commit c80e76b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -703,7 +703,7 @@ public final <X> DataSource<X> fromElements(X... data) {
catch (Exception e) {
throw new RuntimeException("Could not create TypeInformation for type " + data[0].getClass().getName()
+ "; please specify the TypeInformation manually via "
+ "ExecutionEnvironment#fromElements(Collection, TypeInformation)");
+ "ExecutionEnvironment#fromElements(Collection, TypeInformation)", e);
}

return fromCollection(Arrays.asList(data), typeInfo, Utils.getCallLocationName());
Expand Down Expand Up @@ -736,7 +736,7 @@ public final <X> DataSource<X> fromElements(Class<X> type, X... data) {
catch (Exception e) {
throw new RuntimeException("Could not create TypeInformation for type " + type.getName()
+ "; please specify the TypeInformation manually via "
+ "ExecutionEnvironment#fromElements(Collection, TypeInformation)");
+ "ExecutionEnvironment#fromElements(Collection, TypeInformation)", e);
}

return fromCollection(Arrays.asList(data), typeInfo, Utils.getCallLocationName());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -711,7 +711,7 @@ public final <OUT> DataStreamSource<OUT> fromElements(OUT... data) {
catch (Exception e) {
throw new RuntimeException("Could not create TypeInformation for type " + data[0].getClass().getName()
+ "; please specify the TypeInformation manually via "
+ "StreamExecutionEnvironment#fromElements(Collection, TypeInformation)");
+ "StreamExecutionEnvironment#fromElements(Collection, TypeInformation)", e);
}
return fromCollection(Arrays.asList(data), typeInfo);
}
Expand Down Expand Up @@ -744,7 +744,7 @@ public final <OUT> DataStreamSource<OUT> fromElements(Class<OUT> type, OUT... da
catch (Exception e) {
throw new RuntimeException("Could not create TypeInformation for type " + type.getName()
+ "; please specify the TypeInformation manually via "
+ "StreamExecutionEnvironment#fromElements(Collection, TypeInformation)");
+ "StreamExecutionEnvironment#fromElements(Collection, TypeInformation)", e);
}
return fromCollection(Arrays.asList(data), typeInfo);
}
Expand Down Expand Up @@ -785,7 +785,7 @@ public <OUT> DataStreamSource<OUT> fromCollection(Collection<OUT> data) {
catch (Exception e) {
throw new RuntimeException("Could not create TypeInformation for type " + first.getClass()
+ "; please specify the TypeInformation manually via "
+ "StreamExecutionEnvironment#fromElements(Collection, TypeInformation)");
+ "StreamExecutionEnvironment#fromElements(Collection, TypeInformation)", e);
}
return fromCollection(data, typeInfo);
}
Expand Down

0 comments on commit c80e76b

Please sign in to comment.