-
Notifications
You must be signed in to change notification settings - Fork 4.5k
[BEAM-115] Add control of PipelineVisitor recursion into composite transforms #217
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
Conversation
|
R: @bjchambers for Dataflow bits. R: @amitsela this is consistent with intended behavior, yes? I would normally trust that doing this wrong would result in catastrophic test failures, but the odd success of tests for #214 makes me want to be extra careful. R: @mxm touches the Flink slightly, though I didn't go all the way yet. Do you agree that if I do the same thing to the Flink runner that I did to the Spark runner it will mirror the intent? CC: @tgroh non-committer who has been using this stuff most heavily And of course, feedback welcome from anyone on any bit. |
| * Control enum for indicating whether or not a traversal should process the contents of | ||
| * a composite transform or not. | ||
| */ | ||
| public enum Recurse { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Calling this Recurse seems weird. Maybe CompositeDisposition? CompositeBehavior? ShouldRecurse? RecursionBehavior? ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yea, I figured you might have a good choice. I like ShouldRecurse but I'm flexible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, since part of the benefit of an enum over a boolean - aside from readability - is to allow expansion to non-binary decisions, it should be something more like CompositeBehavior or some such.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe CompositeRecurse ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
|
I will take a deeper look (at #214 as well) but it might take me a couple of days.. |
Adjusting in the same way you started with the Spark runner should work. I think we have two cases for composite transforms:
Otherwise, we just visit the primitive transforms that the composite transform is composed of. |
|
+1 from me |
f1b9fea to
1582ab2
Compare
|
OK, I've done the same for the Flink runner. Please take a look. |
| return CompositeBehavior.ENTER_TRANSFORM; | ||
| } | ||
| applyBatchTransform(transform, node, translator); | ||
| LOG.info(genSpaces(this.depth) + "leaveCompositeTranform-" + formatNodeName(node)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
leaveCompositeTransform is not called when you don't enter a composite transform, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
True. I wasn't sure what kind of message you might like to see here so I just made the begin/end symmetrical. Maybe something like "(not recursing) enterCompositeTransform" or whatever would work. But then the format of the string made me think maybe you wanted it to be machine parseable.
I am happy to do anything with these log messages and the depth.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I changed the log to maybe make more sense.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the changes!
1582ab2 to
83446cc
Compare
|
LGTM |
648f26c to
dbf7a06
Compare
[euphoria-core] Publish test jar.
Update `pbs_for_create`, `pbs_for_set_no_merge`, `pbs_for_set_with_merge`, and `pbs_for_update` to match semantics expected by current versions of [conformance tests](googleapis/conformance-tests@0bb8520): - Rather than create separate `Write.transform` messages to hold field transforms, inline them as `update_transforms` in the main `Write.update` message (which will always be created now). Copy in the current version of the conftest JSON files and verify. Closes apache#217
Be sure to do all of the following to help us incorporate your contribution
quickly and easily:
[BEAM-<Jira issue #>] Description of pull requestmvn clean verify. (Even better, enableTravis-CI on your fork and ensure the whole test matrix passes).
<Jira issue #>in the title with the actual Jira issuenumber, if there is one.
Individual Contributor License Agreement.
This is to easily support wholesale replacement of composite transforms. The Flink and Spark runner already achieve this by tracking whether they are in a region of the Pipeline that should be ignored. I ported over the Spark runner to simplify it, but not the Flink runner, to get this PR out for feedback.