5
我想在斯卡拉殼(司機)來定義一個String類型的累加器變量,但我不斷收到以下錯誤: -無法申報串式蓄能器
scala> val myacc = sc.accumulator("Test")
<console>:21: error: could not find implicit value for parameter param: org.apache.spark.AccumulatorParam[String]
val myacc = sc.accumulator("Test")
^
這似乎是沒有問題Int或Double類型的累加器。
感謝
對於整數累加器,val accum = sc.accumulator(0)(SparkContext.IntAccumulatorParam) 。 – Neethu