我正在做Spark(Python)的第一步,我正在努力處理groupByKey()中的迭代器。我無法總結的價值觀:我的代碼如下所示: example = sc.parallelize([('x',1), ('x',1), ('y', 1), ('z', 1)])
example.groupByKey()
x [1,1]
y [1]
z [1]
如何對Iterator的總和?我想是這
我想在斯卡拉殼(司機)來定義一個String類型的累加器變量,但我不斷收到以下錯誤: - scala> val myacc = sc.accumulator("Test")
<console>:21: error: could not find implicit value for parameter param: org.apache.spark.AccumulatorParam[String