0
votes

I am new to GCP Dataflow, just wanted to understand if there is any way to print all values of PCollection.

Pipeline p = Pipeline.create(options);
PCollection<String> lines = p.apply("ReadLines", TextIO.read().from(options.getInputFile()));

Here, I want to print and check all values available in lines(PCollection)

Similarly, want to access all values in words after below operation

PCollection<String> words = lines.apply(
            FlatMapElements.into(TypeDescriptors.strings())
                    .via((String line) -> Arrays.asList(line.split(" "))));
1

1 Answers

1
votes

You will need to process the PCollection in a ParDo. See docs here. Within the ParDo you can inspect each element.