โ† All Apache Spark Flashcard Decks

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
  1. What computation model does the Pregel API in GraphX implement?

    Answer: Bulk-synchronous message-passing between vertices

    The Pregel API implements a bulk-synchronous parallel (BSP) message-passing model where vertices send and receive messages in iterative supersteps until convergence.

  2. In GraphX's `aggregateMessages`, what is the role of the `sendMsg` function?

    Answer: To define what messages are sent along each edge to neighboring vertices

    The `sendMsg` function is called for each edge triplet and specifies what messages, if any, to send to the source and/or destination vertices for aggregation.

  3. What does GraphX's `connectedComponents()` algorithm store as each vertex's attribute in the result graph?

    Answer: The lowest VertexId in its connected component

    connectedComponents() labels each vertex with the lowest VertexId found in its connected component, allowing grouping of all vertices in the same component.

  4. What does the `mapVertices` operation in GraphX do?

    Answer: Transforms vertex attributes using a user-defined function without changing graph structure

    mapVertices applies a function to each vertex's attribute and returns a new Graph with the transformed properties while preserving the original topology.

  5. What is the purpose of the `subgraph` operation in GraphX?

    Answer: To extract a subset of vertices and edges that satisfy a given predicate

    The `subgraph` operation filters vertices and edges using user-supplied predicates, returning a new graph that contains only the elements satisfying both conditions.

  6. Which GraphX algorithm ranks vertices based on the number and quality of their incoming edges?

    Answer: PageRank

    PageRank in GraphX iteratively scores vertices: vertices receiving edges from many highly-ranked vertices accumulate higher rank scores.

  7. What does calling `Graph.reverse` on a GraphX graph produce?

    Answer: A new graph with all edge directions flipped while keeping vertex and edge attributes unchanged

    Graph.reverse returns a new Graph with identical vertices and edges but with every edge's source and destination swapped, reversing the direction of all edges.