Re: [Code Question] Pcollection to List using Java sdk

2022-04-21 Thread Alexey Romanenko
In this case, if you already know that the size of your result is quite small and fits into memory than you need to have to materialise your results on one worker in the same JVM. You can do that with assigning the same key for all result elements and then apply GroupByKey transform over this

Re: [Code Question] Pcollection to List using Java sdk

2022-04-21 Thread Kayal P
Hi Alexey, I have a small result of Pcollection from SQLTransform. I have to pass this result to a mailing class that sends mail, with body as values from Pcollection, In a tabular format. The number of elements in Pcollection will be less than 10 always. Regards, Kayal > > On Apr 21, 2022,

Re: [Code Question] Pcollection to List using Java sdk

2022-04-21 Thread Alexey Romanenko
Hi Kayal, In general, PCollection is infinite collection of elements. So, there is no only one simple way to do what you are asking and the solution will depend on a case where it’s needed. Could you give an example why and where in your pipeline you do need this? — Alexey > On 21 Apr 2022,

[Code Question] Pcollection to List using Java sdk

2022-04-20 Thread Kayal P
Hi All, I am trying to convert Pcollection to List using Java sdk. Seems there is combiners.ToList transform available in python sdk. Is there any similar option available in Java sdk? If not can someone guide me with right way of doing this? The Pcollection is very small collection less than