How do I output to multiple files from PCollection<KV<String, String>>
?
The key in each entry is the file name. The groupByKey transformation gives me PCollection<KV<String, Iterable<String>>>
, but how I can write them to multiple files?
For example, given the following input
<file1, value1>
<file2, value2>
<file1, value3>
I'd like to output two files
file1:
value1
value3
file2:
value2