You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by twalthr <gi...@git.apache.org> on 2015/01/29 16:47:07 UTC

[GitHub] flink pull request: Improved exception for missing type of InputFo...

GitHub user twalthr opened a pull request:

    https://github.com/apache/flink/pull/351

    Improved exception for missing type of InputFormat

    As per discussion on the dev mailing list.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/twalthr/flink ImproveInputFormatException

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/flink/pull/351.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #351
    
----
commit 673640d99f9ab98c18c4fdd3361b9346ec76d2a3
Author: twalthr <tw...@apache.org>
Date:   2015-01-29T15:44:12Z

    Improved exception for missing type of InputFormat

----


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] flink pull request: Improved exception for missing type of InputFo...

Posted by StephanEwen <gi...@git.apache.org>.
Github user StephanEwen commented on the pull request:

    https://github.com/apache/flink/pull/351#issuecomment-72618284
  
    Good idea, Henry, if we can make sure that the IllegalArgumentException is not thrown in any other cases.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] flink pull request: Improved exception for missing type of InputFo...

Posted by StephanEwen <gi...@git.apache.org>.
Github user StephanEwen commented on the pull request:

    https://github.com/apache/flink/pull/351#issuecomment-72629129
  
    I tried to implement Henry's idea, but I noticed the error message is very specific to the site where it is created, since it refers to an alternate method of `DataSet`. It does not make sense to have that specific message in a different place. I would leave it as it is for now...


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] flink pull request: Improved exception for missing type of InputFo...

Posted by StephanEwen <gi...@git.apache.org>.
Github user StephanEwen commented on the pull request:

    https://github.com/apache/flink/pull/351#issuecomment-72623931
  
    I'll merge this...


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] flink pull request: Improved exception for missing type of InputFo...

Posted by hsaputra <gi...@git.apache.org>.
Github user hsaputra commented on the pull request:

    https://github.com/apache/flink/pull/351#issuecomment-72686769
  
    Ah, I meant to suggest different error message to make sure we know either input format or type information is missing.
    
    I will send another PR to implement this.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] flink pull request: Improved exception for missing type of InputFo...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/flink/pull/351


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] flink pull request: Improved exception for missing type of InputFo...

Posted by hsaputra <gi...@git.apache.org>.
Github user hsaputra commented on the pull request:

    https://github.com/apache/flink/pull/351#issuecomment-72162452
  
    To reduce code duplication and tracing, we could just throw the exception inside createInput(InputFormat<X, ?> inputFormat, TypeInformation<X> producedType) by wrapping IllegalArgumentException with InvalidProgramException:
    
    {code}
    public <X> DataSource<X> createInput(InputFormat<X, ?> inputFormat, 
                                                                  TypeInformation<X> producedType) {
      try {
        Preconditions.checkArgument (inputFormat != null, "InputFormat must not be null.");
        Preconditions.checkArgument (producedType != null, 
          "Produced type information must not be null.");
      } catch (IllegalArgumentException iaex) {
        throw new InvalidProgramException(
        "The type returned by the input format could not be automatically determined. " + 
        " Please specify the TypeInformation of the produced type explicitly by using "
        + " the createInput(InputFormat, TypeInformation)' method instead.", iaex);
      }		
      
      return new DataSource<X>(this, inputFormat, producedType, Utils.getCallLocationName());
    }
    {code}
    
    So the other createInput methods callers dont have to deal with the 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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---