I am looking for combining data in a PCollection
input is a CSV file
customer id,customer name,transction amount,transaction type
cust123,ravi,100,D
cust123,ravi,200,D
cust234,Srini,200,C
cust444,shaker,500,D
cust123,ravi,100,C
cust123,ravi,300,C
O/p should be
After reading a Textfile in to a collection of object, i want to combine as the output shown.
cust123,ravi,300,D
cust123,ravi,400,C
cust234,Srini,200,C
cust444,shaker,500,D
Pipeline pipeline = Pipeline.create(
PipelineOptionsFactory.fromArgs(args).withValidation().create());
PCollection< Customer> pCollection =
pipeline.apply("Read", TextIO.read().from("MyFile.csv"))
.apply("splitData and store",
ParDo.of(new TextTransform.SplitValues()))