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

    https://github.com/apache/incubator-flink/pull/203#discussion_r21740006
  
    --- Diff: flink-java/src/main/java/org/apache/flink/api/java/DataSet.java 
---
    @@ -125,6 +130,11 @@ public ExecutionEnvironment getExecutionEnvironment() {
         * @see TypeInformation
         */
        public TypeInformation<T> getType() {
    +           if (type == null) {
    +                   throw new InvalidTypesException("The return type could 
not be determined automatically. "
    --- End diff --
    
    I think we need to be a bit better with the error message. This basically 
says "didn't work, go figure it out". Directing to the log is not quite as good 
as giving the right error message a the right place.
    
    In a prior version, the code had a "MissingTypeInfo". I think that was good 
because that missing type info can hold:
      - The operator (name) where the return type was not determined
      - And the reason for the failure (the exception from the type extractor)
    
    Instead of directing the user to the log, we can throw an exception and in 
that exception describe exactly which operation it was, what the cause was, and 
we can chain the original exception.


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