【发布时间】:2018-03-01 10:27:45
【问题描述】:
groupByKey 的文档中有一些可怕的语言,警告它可能“非常昂贵”,并建议尽可能使用aggregateByKey。
我想知道成本差异是否来自这样一个事实,即对于某些聚合,整个组永远不需要收集并加载到同一个节点,或者是否存在其他实施差异。
基本上,问题是rdd.groupByKey() 是否等同于rdd.aggregateByKey(Nil)(_ :+ _, _ ++ _),还是会更贵。
【问题讨论】:
-
I am wondering whether the difference in cost comes from the fact, that for some aggregattions, the entire group never never needs to be collected and loaded to the same node, or if there are other differences in implementation.正是 -
人民,投票结束 - 想解释一下吗? “不会编程”?嗯?
标签: scala apache-spark