问题
Is there a way to conditionally skip steps in an already-constructed pipeline? Or is pipeline construction designed to be the only way to control which steps are run?
回答1:
Normally, pipeline construction controls what transformations in a pipeline will be executed.
You can, however, imagine a single input, multiple output ParDo that multiplexes the input PCollection to one of the output PCollections. Then, by choosing which output to pass your data to, you can dynamically control which steps are executed -- steps without any input might not be executed and/or their execution might not matter.
A related feature is "parameterized pipelines" or "template pipelines". This is something we are very interested in and are actively working on.
来源:https://stackoverflow.com/questions/40750970/apache-beam-skipping-steps-in-an-already-constructed-pipeline