-
Book Overview & Buying
-
Table Of Contents
Apache Spark Graph Processing
By :
The map operator is a core method for transforming distributed datasets or RDDs in Spark. Similarly, property graphs also have three map operators defined as follows:
class Graph[VD, ED] {
def mapVertices[VD2](mapFun: (VertexId, VD) => VD2): Graph[VD2, ED]
def mapEdges[ED2](mapFun: Edge[ED] => ED2): Graph[VD, ED2]
def mapTriplets[ED2](mapFun: EdgeTriplet[VD, ED] => ED2): Graph[VD, ED2]
}Each of these methods is called on a property graph with vertex attribute type VD and edge attribute type ED. Each of them also takes a user-defined mapping function mapFun that performs one of the following:
For mapVertices, mapFun takes a pair of (VertexId, VD) as input and returns a transformed vertex attribute of type VD2.
For mapEdges, mapFun takes an Edge object as input and returns a transformed edge attribute of type ED2.
For mapTriplets, mapFun takes an EdgeTriplet object as input and returns a transformed edge attribute of type ED2.
In each...
Change the font size
Change margin width
Change background colour