I have a use case where I have to read a big query table into dataflow pipeline, then read each row in that PCollection to construct a graph data structure. And then pass the graph as SideInput to more transform steps that require this graph and another big query table PCollection as arguments. below is what I have right now:
Pipeline pipeline = Pipeline.create(options);
//Read from big query
PCollection<TableRow> bqTable = pipeline.apply("ReadFooBQTable", BigQueryIO.Read.from("Table"));
//Loop over PCollection create "graph" still need to figure this out
//pass the graph as side input
pCol.apply("Process", ParDo.withSideInputs(graph).of(new BlueKai.ProcessBatch(graph))).apply("Write",
Write.to(new DecoratedFileSink<String>(standardBucket, "csv", TextIO.DEFAULT_TEXT_CODER, null, null, WriterOutputGzipDecoratorFactory.getInstance())).withNumShards(numChunks));