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

Fix DoFnTester side inputs #659

Closed
wants to merge 5 commits into from

Conversation

tgroh
Copy link
Member

@tgroh tgroh commented Jul 14, 2016

Be sure to do all of the following to help us incorporate your contribution
quickly and easily:

  • Make sure the PR title is formatted like:
    [BEAM-<Jira issue #>] Description of pull request
  • Make sure tests pass via mvn clean verify. (Even better, enable
    Travis-CI on your fork and ensure the whole test matrix passes).
  • Replace <Jira issue #> in the title with the actual Jira issue
    number, if there is one.
  • If this contribution is large, please file an Apache
    Individual Contributor License Agreement.

The side inputs were being stored as iterables, but being returned as
the raw type.

Store the side input values directly instead.

The side inputs were being stored as iterables, but being returned as
the raw type.

Store the side input values directly instead.
@tgroh
Copy link
Member Author

tgroh commented Jul 14, 2016

R: @kennknowles

return WindowedValue.valueInGlobalWindow(input);
}
}));
public <T> void setSideInput(
Copy link
Member

Choose a reason for hiding this comment

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

Why this change? The additional method for just a single value seems fine, but the case for adding globally windowed data remains. At the least, update the javadoc to indicate that you aren't setting the entirety of the PCollection contents. Is it unused?

Copy link
Member Author

Choose a reason for hiding this comment

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

I've done a bit of cleanup, including removing the setSideInput without window method.

The other two commits are mainly cleanup of dead (or effectively dead) code.

Side Outputs are appended to the map of outputs on-demand.
No in-package representation refers to the fields of DoFnTester
directly.
@kennknowles
Copy link
Member

LGTM. Nice catch. I'll merge in a couple minutes, let Travis have a chance to catch up.

*/
public void setSideOutputTags(TupleTagList sideOutputTags) {
Copy link
Member

Choose a reason for hiding this comment

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

...

Copy link
Member Author

Choose a reason for hiding this comment

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

This line is mostly a diff failure.

I believe that both Side Input behaviors are reasonable; although I can also see an argument for throwing an illegal state exception if the (PCollectionView, BoundedWindow) was not specified, and adding a setSideInputDefault(PCollectionView, BoundedWindow) method.

@asfgit asfgit closed this in cb03569 Jul 15, 2016
pl04351820 pushed a commit to pl04351820/beam that referenced this pull request Dec 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants