java newbie here. I'm struggling to understand how to use ParseJsons in my Apache Beam pipeline to parse a string PCollection into an object PCollection.
My understanding is that I need to first define a class that matches the json structure, and then use ParseJsons to map the json strings into objects of that class.
However, the ParseJsons documentation looks cryptic to me. I'm not sure how to actually perform the transform using Apache Beam. Could someone give me a quick and dirty example of how to parse line delimited json strings?
Here's one of the attempts I've made, but unfortunately the syntax is incorrect.
class Product {
private String name = null;
private String url = null;
}
p.apply("ReadLines", TextIO.read().from(options.getInputFile()))
.apply(new ParseJsons.of(Product))
.apply("WriteCounts", TextIO.write().to(options.getOutput()));