user_1357
user_1357

Reputation: 7940

Apache Beam/Dataflow: Passing in attributes between Transforms

Is there a way to pass meta data/attributes between PTransforms? This information is not part of a element, but should be accessible when processing elements. I have a constraint that this information cannot be passed in as a constructor argument.

Upvotes: 0

Views: 650

Answers (1)

Alex
Alex

Reputation: 5276

Why can't it be passed in as a constructor argument?

Is the value unknown until you get to a particular Transform? If so, the you could retrieve it as an additional output, and then input it everywhere it is needed as a side-input by using pvalue.

https://beam.apache.org/documentation/programming-guide/#additional-outputs

https://beam.apache.org/documentation/programming-guide/#side-inputs

https://beam.apache.org/releases/pydoc/2.8.0/apache_beam.pvalue.html#apache_beam.pvalue.AsSingleton

Upvotes: 2

Related Questions