我正在尝试为 Graphframes 内的 parallelPersonalizedPageRank 算法生成 sourceIds 并调用该算法,如下所示:
val PPRIdCS = studentCS.select("id").collect.map(row => row.getString(0))
val ranksCS = studentGraph
.parallelPersonalizedPageRank
.resetProbability(0.15)
.maxIter(10)
.sourceIds(PPRIdCS)
.run()
Run Code Online (Sandbox Code Playgroud)
我得到的错误信息如下:
Message: <console>:46: error: type mismatch;
found : Array[String]
required: Array[Any]
Note: String <: Any, but class Array is invariant in type T.
You may wish to investigate a wildcard type such as `_ <: Any`. (SLS
3.2.10).sourceIds(PPRIdCS)
Run Code Online (Sandbox Code Playgroud)
我无法弄清楚将 String 类型转换为 Any 类型的方法是什么,或者在生成 PPRIdCS 时将 String 映射到 Any 的方法。谢谢!