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

[BEAM-8965] Remove duplicate sideinputs in ConsumerTrackingPipelineVisitor #10901

Merged
merged 3 commits into from Feb 26, 2020

Conversation

bobingm
Copy link
Contributor

@bobingm bobingm commented Feb 19, 2020

Summary

This PR is mainly preventing BundleBasedDirectRunner evaluates single side_input more than once.

To achieve this, this PR changes the logic to get side_input views in ConsumerTrackingPipelineVisitor, and modify the unit tests to make sure that when one single side_input is used in two different PTransforms, it will be evaluated once.

Check List

Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:

  • Choose reviewer(s) and mention them in a comment (R: @username).
  • Format the pull request title like [BEAM-XXX] Fixes bug in ApproximateQuantiles, where you replace BEAM-XXX with the appropriate JIRA issue, if applicable. This will automatically link the pull request to the issue.
  • Update CHANGES.md with noteworthy changes.
  • If this contribution is large, please file an Apache Individual Contributor License Agreement.

See the Contributor Guide for more tips on how to make review process smoother.

Post-Commit Tests Status (on master branch)

Lang SDK Apex Dataflow Flink Gearpump Samza Spark
Go Build Status --- --- Build Status --- --- Build Status
Java Build Status Build Status Build Status Build Status
Build Status
Build Status
Build Status Build Status Build Status
Build Status
Build Status
Python Build Status
Build Status
Build Status
Build Status
--- Build Status
Build Status
Build Status
Build Status
--- --- Build Status
XLang --- --- --- Build Status --- --- ---

Pre-Commit Tests Status (on master branch)

--- Java Python Go Website
Non-portable Build Status Build Status
Build Status
Build Status Build Status
Portable --- Build Status --- ---

See .test-infra/jenkins/README for trigger phrase, status and link of all Jenkins jobs.

@bobingm
Copy link
Contributor Author

bobingm commented Feb 19, 2020

R: @pabloem @charlesccychen

@bobingm
Copy link
Contributor Author

bobingm commented Feb 25, 2020

Run Python Postcommit

@pabloem
Copy link
Member

pabloem commented Feb 25, 2020

Thanks! I'll take a look : )

@pabloem
Copy link
Member

pabloem commented Feb 25, 2020

Run Python Postcommit

@pabloem
Copy link
Member

pabloem commented Feb 25, 2020

Run Python 3.5 Postcommit

self.views.append(side_input)
if side_input not in self._side_input_views:
self._side_input_views[side_input] = side_input
self.views = [
Copy link
Member

Choose a reason for hiding this comment

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

Here we may want to only append rather than rebuild all of self.views?

An idea is that we may want to keep self._views = set(), add views to the set, and add a @property that returns the set as a list? (no need to implement this way, but we do want to make sure that we are not dropping elements from 'views' that we appended in previous visit_transform calls

@pabloem
Copy link
Member

pabloem commented Feb 26, 2020

Run Python PreCommit

@pabloem
Copy link
Member

pabloem commented Feb 26, 2020

Retest this please

@iemejia
Copy link
Member

iemejia commented Feb 26, 2020

retest this please

@pabloem
Copy link
Member

pabloem commented Feb 26, 2020

thanks @bobingm ! Looks good to me. Can you fix the formatting issues, and I'll merge?

@bobingm
Copy link
Contributor Author

bobingm commented Feb 26, 2020

@pabloem the failure is not caused by this PR.

@pabloem
Copy link
Member

pabloem commented Feb 26, 2020

I see. Thanks for pointing that out.

@pabloem pabloem merged commit 079317d into apache:master Feb 26, 2020
@pabloem
Copy link
Member

pabloem commented Feb 26, 2020

thanks @bobingm

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

Successfully merging this pull request may close these issues.

None yet

3 participants