1
在spark map函數中使用下劃線參數或命名參數時,我看到一些差異。scala下劃線參數不作爲命名參數,在火花映射中減少
看看這個代碼(在火花外殼執行):
var ds = Seq(1,2,3).toDS()
ds.map(t => Array("something", "" + t)).collect // works cool
ds.map(Array("funk", "" + _)).collect // doesn't work
我得到了不工作線的例外是:
error: Unable to find encoder for type stored in a Dataset. Primitive types (Int, String, etc) and Product types (case classes) are supported by importing spark.implicits._ Support for serializing other types will be added in future releases.
在第二個代碼行中有一個額外的'「」+「。 –
@Alexey謝謝!固定。 –