我已经关注了PTables
PTable<String, String> somePTable1 = somePCollection1.parallelDo(new SomeClass(),
Writables.tableOf(Writables.strings(), Writables.strings()));
PTable<String, Collection<String>> somePTable2 = somePTable1.collectValues();对于上面描述的somePTable2,我想为somePTable2中的每条记录创建一个新文件,有没有办法遍历somePTable2以便访问记录。我知道我可以将DoFn应用于somePTable2,但是否可以在DoFn中应用pipeline.write()操作?
发布于 2017-08-18 09:38:31
试着按原样存储列表
somePTable2.values().write()如果希望在PTable中为集合中的每个元素生成一条记录,则需要在编写集合中的每个元素之前应用DoFn并发出一条记录。
https://stackoverflow.com/questions/45737731
复制相似问题