此scala代码片段中的错误是什么?

时间:2018-09-26 08:34:36

标签: java arrays scala apache-spark rdd

我是scala和火花的新手。我在intellij上获得以下声明,该声明位于主要功能内:-

val userIdBySession = epochByUserId.map(getSessions)

intellij的编译错误:-

Type Mismatch, expected:(String, Seq[Long])=> NotInferedU, 
                 actual:(String, Seq[Long])=> (String, Int, Int, Int, Int)

我对getSessions方法的声明:

def getSessions(userId:String, epochList:Seq[Long]):(String, Int, Int, Int, Int)

epochByUserId RDD的示例:

(b3a60c78,CompactBuffer(1471330761, 1471330761, 1471330791, 1471330791))
(eaefd399,CompactBuffer(1471330773))
(721f634f,CompactBuffer(1471330820))

如何更正此编译错误?我为什么会收到错误消息:NotInferedU。另外,compactBuffer类型是否与getSessions定义中的Seq [Long]相对应?

0 个答案:

没有答案