Object class is
class VertexAttributes(val m: Boolean, n: Any){
val rootParentCustNumber: String = if(n == null) "Was Null" else n.toString
val firstMsgFlg = m
}
I have an RDD of this object's type:
scala> myGraph.vertices
res92: org.apache.spark.graphx.VertexRDD[VertexAttributes] = VertexRDDImpl[2280] at RDD at VertexRDD.scala:57
Filtering on the RDD, I get the following:
scala> res92.filter{case(k,m) => k == 964088677}.collect
res94: Array[(org.apache.spark.graphx.VertexId, VertexAttributes)] = Array((964088677,VertexAttributes@2612b83f))
How can I access [email protected] in Array((964088677,VertexAttributes@2612b83f))
I have tried res92.filter{case(k,m) => k == 964088677}.map{case Array(k,m)=> m.rootParentCustNumber}
But I get the following error:
<console>:243: error: pattern type is incompatible with expected type;
found : Array[T]
required: (org.apache.spark.graphx.VertexId, VertexAttributes)
(which expands to) (Long, VertexAttributes)
res92.filter{case(k,m) => k == 964088677}.map{case Array(k,m)=> m.rootParentCustNumber}
^
filterstage:.map{ case (k, m) => m.rootParentCustNumber }res92.filter{ case(k, m) => k == 964088677 }.map{ case (k, m) => m.rootParentCustNumber }