GraphX and Graph Processing Flashcards
7 cards from real Apache Spark practice questions. Tap to flip, then mark Knew It or Still Learning โ missed cards come back until you master them.
Read the first 7 GraphX and Graph Processing flashcards as text
What is Apache Spark GraphX primarily used for?
Answer: Graph-parallel computation and graph analytics
GraphX is Spark's API for graph-parallel computation, enabling graph creation, transformation, and execution of graph algorithms at scale.
In GraphX, what are the two fundamental components of a Property Graph?
Answer: Vertices and Edges
A Property Graph in GraphX consists of vertices (nodes) and edges (connections), each carrying associated user-defined properties.
Which data type is used as a vertex identifier (VertexId) in GraphX?
Answer: Long (64-bit integer)
GraphX defines VertexId as a type alias for Long, providing a large namespace of unique IDs suitable for billions of vertices.
What distributed collection type does GraphX use internally to store vertex attributes?
Answer: VertexRDD
GraphX uses VertexRDD[VD], which extends RDD[(VertexId, VD)], to store and index vertex attributes as key-value pairs.
What method in GraphX creates a graph from an RDD of edges, assigning a default attribute to all vertices?
Answer: Graph.fromEdges()
Graph.fromEdges() constructs a graph from an RDD[Edge[ED]] and automatically creates vertex entries with a supplied default attribute.
What does the `triplets` property of a GraphX Graph return?
Answer: An RDD of EdgeTriplet objects containing source vertex, edge, and destination vertex attributes
The `triplets` property returns an RDD[EdgeTriplet[VD, ED]], where each triplet combines the source vertex, the connecting edge, and the destination vertex with all their attributes.
Which GraphX edge partitioning strategy assigns edges to partitions based solely on the source vertex ID?
Answer: EdgePartition1D
EdgePartition1D assigns edges to partitions by hashing only the source vertex ID, colocating all outgoing edges from the same vertex in one partition.