I have a PCollection<KV<String,String>>
. I want to group data by K and write all values for a Key K into file(s) on google storage inside a folder named K. Suppose I have 2 entries after using by to group the values.
['a',[apple,as]],['b','bat,ball']
I want to write all the file by name data_record.txt inside folder-name 'a' for 'apple,as' and 'b' for 'bat,ball'.
How can I create dynamic folder names using FileIO.dynamicWrite
? The folder must be named by the key used to group.