小编Ans*_*ary的帖子

Spark中发现相同和所需数据类型的“错误:类型不匹配”

我正在使用spark-shell来运行我的代码。在我的代码中,我定义了一个函数,并使用其参数调用该函数。

问题是调用函数时出现以下错误。

error: type mismatch;

found   : org.apache.spark.graphx.Graph[VertexProperty(in class $iwC)(in class $iwC)(in class $iwC)(in class $iwC),String]

required: org.apache.spark.graphx.Graph[VertexProperty(in class $iwC)(in class $iwC)(in class $iwC)(in class $iwC),String]
Run Code Online (Sandbox Code Playgroud)

此错误的原因是什么?它与Spark中的Graph数据类型有关系吗?

代码:这是我代码的一部分,涉及函数“ countpermissions”的定义和调用。

class VertexProperty(val id:Long) extends Serializable
case class User(val userId:Long, val userCode:String, val Name:String, val Surname:String) extends VertexProperty(userId)
case class Entitlement(val entitlementId:Long, val name:String) extends VertexProperty(entitlementId)

def countpermissions(es:String, sg:Graph[VertexProperty,String]):Long = {
    return 0
}

val triplets = graph.triplets
val temp = triplets.map(t => t.attr)
val distinct_edge_string = temp.distinct    
var bcast_graph = sc.broadcast(graph) …
Run Code Online (Sandbox Code Playgroud)

scala apache-spark spark-graphx

6
推荐指数
1
解决办法
2496
查看次数

Bigram到矢量

我想使用word2vec工具为文档构建单词嵌入.我知道如何找到对应于单个单词(unigram)的向量嵌入.现在,我想找到一个二元组的向量.是否可以使用word2vec?如果有,怎么样?

nlp word2vec word-embedding

5
推荐指数
1
解决办法
3572
查看次数