July 2017
Intermediate to advanced
796 pages
18h 55m
English
mapValues() maps each vertex attribute, preserving the index so as not to change the vertexId. Changing the vertexId would have changed the index so much that subsequent operations would fail and the vertices will not be reachable anymore. Hence, it is important to not change the vertexIds.
The declaration of this function is shown here:
def mapValues[VD2: ClassTag](f: VD => VD2): VertexRDD[VD2]//A variant of the mapValues() function accepts a vertexId in addition to the vertices.def mapValues[VD2: ClassTag](f: (VertexId, VD) => VD2): VertexRDD[VD2]
mapValues() can also operate on the edges and maps the values in an edge partitioning preserving the structure but changing the values:
def mapValues[ED2: ClassTag](f: Edge[ED] => ED2): ...
Read now
Unlock full access