Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FLINK-6549] [DataStream API] Improve error message for type mismatches with side outputs #4663

Closed
wants to merge 5 commits into from

Conversation

bowenli86
Copy link
Member

@bowenli86 bowenli86 commented Sep 9, 2017

What is the purpose of the change

A type mismatch when using side outputs causes a ClassCastException to be thrown. It would be neat to include the name of the OutputTags in the exception message.

This can occur when multiple OutputTags with different types but identical names are being used.

Brief change log

With this change, ClassCastException will be caught separately. We will replace it with a new one that has enriched error message. The enriched error message will have OutputTag's id, and a brief explanation of why this error may occur.

Verifying this change

This change is a trivial rework / code cleanup without any test coverage.

The new error message looks like this:

Caused by: java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.String. Failed to push OutputTag with id 'mytag' to operator. This can occur when multiple OutputTags with different types but identical names are being used.

Does this pull request potentially affect one of the following parts:

Documentation

  • Does this pull request introduce a new feature? (no)

@zentol
Copy link
Contributor

zentol commented Sep 11, 2017

I think this looks good.

@bowenli86
Copy link
Member Author

Hi @zentol , let me know if you can help merge this in :)

@yew1eb
Copy link
Contributor

yew1eb commented Sep 18, 2017

LGTM

@zentol
Copy link
Contributor

zentol commented Sep 18, 2017

merging.

zentol pushed a commit to zentol/flink that referenced this pull request Sep 18, 2017
@asfgit asfgit closed this in 5fc1103 Sep 19, 2017
zentol pushed a commit to zentol/flink that referenced this pull request Sep 19, 2017
asfgit pushed a commit that referenced this pull request Sep 28, 2017
"but identical names are being used.",
e.getMessage(), outputTag.getId()));

throw new ExceptionInChainedOperatorException(replace);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Swallows the original exception which is never a good thing for someone trying to diagnose a problem like this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants