In case if we could return List<ABC> from DoFn<> then we could use the code as suggested in section 3.1.2 and mentioned by you below., but the return type of DoFn<> is always PCollection<> in where I could not have the list of ABC objects which further will be fed as input for parallel computation. Is there any possibility to convert List<ABC> to PCollection<ABC> in DoFn<> itself? OR can DoFn<> return List<ABC> objects?
From: Robert Bradshaw [mailto:robertwb@xxxxxxxxxx]
You can use the Create transform to do this, e.g.
Pipeline p = ...
List<ABC> inMemoryObjects = ...
PCollection<ABC> pcollectionOfObject = p.apply(Create.of(inMemoryObjects));
result = pcollectionOfObject.apply(ParDo.of(SomeDoFn...));
See section 3.1.2 at https://beam.apache.org/documentation/programming-guide/#pcollections
On Wed, Jun 6, 2018 at 8:34 AM S. Sahayaraj <ssahayaraj@xxxxxxxxx> wrote: