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-6858] Validate that side-input parameters match the type of the PCollectionView #9372

Merged
merged 6 commits into from Sep 7, 2019

Conversation

reuvenlax
Copy link
Contributor

@reuvenlax reuvenlax commented Aug 19, 2019

Validate that the type of a processElement side-input parameter matches that of the PCollectionView.

Note: Suppliers are used because often the TypeDescriptor is not Serializable, and so cannot be captured in the PCollectionView.

@@ -107,7 +108,8 @@ public void cleanup() throws Exception {
List<PCollectionView<?>> sideInputs,
TupleTag<OutputT> mainOutputTag,
List<TupleTag<?>> additionalOutputTags,
DoFnSchemaInformation doFnSchemaInformation)
DoFnSchemaInformation doFnSchemaInformation,
Map<String, String> sideInputMapping)
Copy link
Contributor

Choose a reason for hiding this comment

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

@reuvenlax This should be String, String? or PCollectionView

@reuvenlax
Copy link
Contributor Author

reuvenlax commented Aug 20, 2019 via email

@reuvenlax reuvenlax changed the title Plumb side-input mapping through [Beam-6858] Validate that side-input parameters match the type of the PCollectionView Aug 25, 2019
@reuvenlax
Copy link
Contributor Author

run Flink ValidatesRunner

@reuvenlax
Copy link
Contributor Author

Run Dataflow ValidatesRunner

@reuvenlax
Copy link
Contributor Author

Run Portable_Python PreCommit

@reuvenlax
Copy link
Contributor Author

R: @TheNeuralBit

Copy link
Member

@TheNeuralBit TheNeuralBit left a comment

Choose a reason for hiding this comment

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

LGTM, Just a couple of suggestions

sideInput.sideInputId());
TypeDescriptor<?> viewType = view.getViewFn().getTypeDescriptor();

// Currently check that the types exactly match, even if the types are convertible.
Copy link
Member

Choose a reason for hiding this comment

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

Are there plans to handle convertible types? Should there be a JIRA thats linked here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We have the same issue with Element parameters. I'll check to see if we have a JIRA for this (I think a user actually filed one some time back).

.apply(ParDo.of(fn).withSideInput(sideInputTag1, sideInput1));
pipeline.run();
}

Copy link
Member

Choose a reason for hiding this comment

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

Would you mind adding tests for the remaining view types - Map, Multimap, Iterable?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

tests added

@reuvenlax
Copy link
Contributor Author

all comments addressed

@reuvenlax reuvenlax merged commit 9043b3e into apache:master Sep 7, 2019
soyrice pushed a commit to soyrice/beam that referenced this pull request Sep 19, 2019
…parameters match the type of the PCollectionView
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

3 participants