Skip to content

Conversation

@kennknowles
Copy link
Member

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.

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.

@kennknowles
Copy link
Member Author

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 {
Copy link
Contributor

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? ...

Copy link
Member Author

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.

Copy link
Member Author

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.

Copy link
Member

Choose a reason for hiding this comment

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

Maybe CompositeRecurse ?

Copy link
Member Author

Choose a reason for hiding this comment

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

Done

@amitsela
Copy link
Member

I will take a deeper look (at #214 as well) but it might take me a couple of days..

@mxm
Copy link
Contributor

mxm commented Apr 21, 2016

@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?

Adjusting in the same way you started with the Spark runner should work. I think we have two cases for composite transforms:

  • direct translation of composite transforms
  • conditional composite transform translation depending on the number of inputs

Otherwise, we just visit the primitive transforms that the composite transform is composed of.

@amitsela
Copy link
Member

+1 from me

@kennknowles kennknowles force-pushed the pipeline-recurse branch 2 times, most recently from f1b9fea to 1582ab2 Compare April 29, 2016 17:48
@kennknowles
Copy link
Member Author

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));
Copy link
Contributor

@mxm mxm May 2, 2016

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?

Copy link
Member Author

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.

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 changed the log to maybe make more sense.

Copy link
Contributor

Choose a reason for hiding this comment

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

I like the changes!

@mxm
Copy link
Contributor

mxm commented May 6, 2016

LGTM

@asfgit asfgit merged commit dbf7a06 into apache:master May 9, 2016
asfgit pushed a commit that referenced this pull request May 9, 2016
@kennknowles kennknowles deleted the pipeline-recurse branch November 10, 2016 03:10
iemejia pushed a commit to iemejia/beam that referenced this pull request Jan 12, 2018
mareksimunek pushed a commit to mareksimunek/beam that referenced this pull request May 9, 2018
pl04351820 pushed a commit to pl04351820/beam that referenced this pull request Dec 20, 2023
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
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.

5 participants