[ 
https://issues.apache.org/jira/browse/FLINK-1245?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14244029#comment-14244029
 ] 

ASF GitHub Bot commented on FLINK-1245:
---------------------------------------

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.


> Introduce TypeHints for Java API operators
> ------------------------------------------
>
>                 Key: FLINK-1245
>                 URL: https://issues.apache.org/jira/browse/FLINK-1245
>             Project: Flink
>          Issue Type: Improvement
>          Components: Java API
>            Reporter: Timo Walther
>            Assignee: Timo Walther
>
> Due to type extraction issues with Java 8 Lambdas and many users with type 
> erasure issues, TypeHints need to be introduced.
> The whole discussion can be found on the mailing list:
> http://mail-archives.apache.org/mod_mbox/flink-dev/201410.mbox/%[email protected]%3E



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to