1

To gain some of the benefits only possible with reducers and not mappers.

4

1 回答 1

1

在 Google Groups 中找到了我的答案:

在执行分组时使用GroupBywhich invariable 将使用 reducer:

previousPipe = new GroupBy(previousPipe); //this does a Group on Fields.All

减少文件数量(另一种耦合较少的替代方案)

previousPipe = new GroupBy(previousPipe, new Fields("rand"), 
               new RandonNumGen(Fields.Args));

其中 new RandonNumGen(Fields.Args) 是您构建的一个函数,Function用于创建一个新的 Fields("rand") 来创建临时随机数(临时意味着您稍后删除该字段)。

有关更多信息,请查看此Google Groups线程:

于 2013-05-06T13:52:37.440 回答