Checking your account

You can read the lesson while its saved answers and constructions load. Learning controls will open once that work is ready.

The Basics of Spark

What Does Spark Do?

Apache Spark is an open-source engine for processing data. We describe a calculation, and Spark organizes the tasks that produce its result. Those tasks can run across several computers, although Spark also runs on one machine for smaller workloads.

Our maintenance team has a named table of pump readings. Before calculating an average or preparing a model input, we want to know how many records arrived. On one computer, we could count every row in a list. If the records are divided into portions, each portion can contribute a count and those counts can be combined.

We will follow that calculation before using Spark’s programming interface. It gives a concrete meaning to partitions, tasks and the processes that run them. Databricks manages the computing environment in this sequence; Spark supplies the processing engine.

These are local lists representing partition contents. No actual Spark tasks or cloud computers run here, and the workshop does not measure parallel speed or recovery behavior.

Step 1 of 1

Follow a Count Through Spark

Start with the records and the work, then attach each process name to its responsibility.

  1. What data is available?

    Component
    Partitions
    Its job in this example
    Each portion contains some of the pump readings
  2. What does one portion contribute?

    Component
    A counting task
    Its job in this example
    Produces a partial count for that partition
  3. What executes the task?

    Component
    An executor process
    Its job in this example
    Works on its assigned partition and returns a result
  4. What coordinates the application?

    Component
    The driver
    Its job in this example
    Schedules the work needed to produce the requested result
  5. What answer did we request?

    Component
    The combined count
    Its job in this example
    Adds the partial counts without dropping any records
The local workshop exposes partial counts. It does not run Spark or predict task timing.

Describe the Calculation Over a Table

Each partition contributes its own count. Adding those partial counts preserves the total even when the partition boundaries move.