Apache Spark

Glossary

Every Apache Spark term in plain words, with the module that teaches it. Inside modules, any word with a dotted underline explains itself.

Apache Spark · 77 terms

A

Action
An operation that needs a real result, such as count, show, collect or write. It makes Spark run the plan as a job.
Learn it in “Transformations, actions and laziness” →
Adaptive Query Execution (AQE)
A Spark SQL feature that re-optimises the rest of a query while it runs, using the real sizes of data written at each shuffle. On by default since Spark 3.2.
Learn it in “Adaptive Query Execution” →
ANSI mode
Spark SQL's standards-following behaviour, on by default since Spark 4.0: invalid input such as a bad cast or integer overflow raises an error instead of silently returning NULL or a wrong number.
Learn it in “Spark SQL and the DataFrame API” →
Apache Arrow
A standard in-memory columnar data format. Spark uses it to move data between the JVM and Python in batches instead of row by row.
Learn it in “PySpark, Arrow and UDFs” →

B

Broadcast join
A join where Spark copies the small table to every executor, so the large table can be joined where it sits without a shuffle.
Learn it in “Join strategies” →

C

Cache (Spark)
Keeping a computed DataFrame or RDD in executor memory or on local disk after its first use, so later actions reuse it instead of recomputing it.
Learn it in “Caching and persistence” →
Catalyst
Spark SQL's query optimiser. It turns SQL or DataFrame code into a logical plan, rewrites it with rules, chooses a physical plan and generates code to run it.
Think of it as: A route planner: you give the destination, it picks the route.
Learn it in “The Catalyst optimiser” →
Checkpoint location
A folder where a streaming query records the offsets it has processed and its state, so it can restart exactly where it stopped.
Learn it in “Structured Streaming” →
Cluster
A group of computers working together as one system, each handling part of a job.
Learn it in “Why Spark exists” →
Cluster manager
The service that gives a Spark application machines to run on: Spark's standalone manager, Hadoop YARN or Kubernetes.
Learn it in “Driver, executors and the cluster” →
coalesce
A DataFrame operation that reduces the number of partitions by merging neighbouring ones, without a full shuffle. It cannot increase the count.
Learn it in “Partitions and parallelism” →
Column pruning
Dropping columns a query never uses, so they are never read; especially effective with columnar files like Parquet.
Learn it in “The Catalyst optimiser” →

D

DAG
Directed acyclic graph: the network of steps Spark builds from your transformations, with arrows from each step to the ones that use its output and no loops.
Learn it in “Transformations, actions and laziness” →
Data skew
When a few keys hold most of the rows, so after a shuffle a few tasks do most of the work while the rest sit idle.
Learn it in “Data skew” →
DataFrame
A distributed table of rows with named, typed columns. Because Spark knows the schema and the operations, it can optimise DataFrame code heavily.
Think of it as: A labelled spreadsheet rather than a box of papers.
Learn it in “RDDs, DataFrames and Datasets” →
Dataset (Spark)
A typed version of a DataFrame for Scala and Java, combining compile-time types with Spark's optimiser. In those languages a DataFrame is a Dataset of rows.
Learn it in “RDDs, DataFrames and Datasets” →
Decommissioning
Shutting an executor down gracefully, trying to move its shuffle and cached blocks elsewhere first, for example when a spot machine is reclaimed.
Learn it in “Cost and right-sizing” →
Deploy mode
Where a Spark application's driver runs: inside the cluster (cluster mode) or on the machine that submitted it (client mode).
Learn it in “Driver, executors and the cluster” →
Driver
The process that runs your Spark program, creates the SparkSession, plans the work and schedules tasks on executors.
Think of it as: A head chef who plans the order and hands out jobs.
Learn it in “Driver, executors and the cluster” →
Dynamic allocation
A Spark setting that adds executors when tasks are waiting and removes ones that have been idle (60 s by default), so you pay for what the job is using.
Learn it in “Cost and right-sizing” →

E

Exchange
The operator in a Spark physical plan that marks a shuffle (or a broadcast) of data between stages.
Learn it in “The shuffle” →
Execution memory
The part of an executor's memory used for the work in hand: shuffles, joins, sorts and aggregations. Shared with storage memory in one pool.
Learn it in “Memory, spill and out-of-memory” →
Executor
A process started for one Spark application on a worker machine. It runs tasks and keeps data in memory or on disk for that application.
Learn it in “Driver, executors and the cluster” →
External shuffle service
A long-running process on each node that serves shuffle files on behalf of executors, so they stay available after an executor is removed. Off by default; not available on Kubernetes.
Learn it in “The shuffle” →

H

History Server
A Spark service that rebuilds the UI of finished applications from their event logs.
Learn it in “Jobs, stages and tasks” →

I

In-memory processing
Keeping data in a computer's main memory between processing steps instead of writing it to disk and reading it back, which is much faster.
Learn it in “Why Spark exists” →
Iterative job
A job that passes over the same data many times, such as training a machine-learning model. It benefits most from keeping data in memory.
Learn it in “Why Spark exists” →

J

Job
All the work Spark does in response to one action, such as count or write. One action can start more than one job.
Learn it in “Jobs, stages and tasks” →
Join hint
An instruction in a query (BROADCAST, MERGE, SHUFFLE_HASH or SHUFFLE_REPLICATE_NL) suggesting which join strategy Spark should use. Not guaranteed.
Learn it in “Join strategies” →

L

Lazy evaluation
Delaying work until a result is actually needed. Spark records transformations and only runs them when an action is called, so it can optimise the whole plan first.
Think of it as: A personal shopper who writes the list and only sets off when you say go.
Learn it in “Transformations, actions and laziness” →
Lineage
The recorded chain of transformations that produced a dataset. Spark uses it to recompute lost partitions instead of keeping copies.
Think of it as: Keeping the recipe, so you can cook the dish again.
Learn it in “RDDs, DataFrames and Datasets” →
Logical plan
A tree describing what a query computes (filters, joins, aggregations) without saying how each step will run.
Learn it in “The Catalyst optimiser” →

M

Managed Spark service
A cloud service that installs, patches and runs Spark clusters for you, such as Amazon EMR, Databricks or Google's Managed Service for Apache Spark.
Learn it in “Running Spark” →
MapReduce
Google's 2004 model for processing large data on many machines: a map step processes each piece, a reduce step combines results by key. Hadoop made it widely available; it writes data to disk between steps.
Learn it in “Why Spark exists” →
Memory overhead
Memory an executor's container gets on top of the Java heap, for native and other non-heap use. By default 10% of executor memory, at least 384 MB.
Learn it in “Memory, spill and out-of-memory” →
Micro-batch
A small batch job covering the data that arrived since the last one. Structured Streaming runs streams as a series of micro-batches by default.
Learn it in “Structured Streaming” →

N

Narrow transformation
A transformation where each output partition needs data from only one input partition, like filter or select. Spark can chain these together without moving data.
Learn it in “Transformations, actions and laziness” →
Native engine
An execution engine written in C++ or Rust that runs Spark's query plans outside the JVM, such as Photon, Apache Gluten's backends or DataFusion Comet.
Learn it in “Tungsten and vectorised engines” →

P

pandas UDF
A Python UDF that receives whole columns as pandas Series, shipped in batches with Apache Arrow, so the work is vectorised. Introduced in Spark 2.3.
Learn it in “PySpark, Arrow and UDFs” →
Parallelism
How many tasks run at the same time; limited by both the number of partitions and the number of free task slots (cores).
Learn it in “Partitions and parallelism” →
Partition
One chunk of a distributed dataset. Spark processes each partition with one task, so the number of partitions limits how much work runs at once.
Think of it as: A bundle of exam papers handed to one marker.
Learn it in “Partitions and parallelism” →
Partition pruning
Skipping whole folders of a partitioned table because a filter on the partition column shows they can't contain matching rows.
Learn it in “Reading and writing files” →
Physical plan
A tree describing exactly how a query will run: which scan, which join algorithm, where data is exchanged between machines.
Learn it in “The Catalyst optimiser” →
Predicate pushdown
Moving a filter as early as possible in a plan, ideally into the data source itself, so less data is read and processed.
Learn it in “The Catalyst optimiser” →
Project Tungsten
A Spark effort begun in 2015 to use memory and CPU more efficiently: Spark-managed binary memory instead of Java objects, cache-aware algorithms and code generation.
Learn it in “Tungsten and vectorised engines” →
Py4J
The library PySpark uses to let your Python program call into Spark's JVM driver.
Learn it in “PySpark, Arrow and UDFs” →

Q

Query stage
In AQE, a part of the plan that ends at a shuffle or broadcast. When it finishes, Spark has real statistics and can re-plan what comes next.
Learn it in “Adaptive Query Execution” →

R

RDD (resilient distributed dataset)
Spark's original data abstraction: an immutable collection of objects split into partitions across a cluster, processed by your functions, and rebuilt from its lineage if a partition is lost.
Learn it in “RDDs, DataFrames and Datasets” →
repartition
A DataFrame operation that reshuffles all rows into a new number of evenly balanced partitions, optionally by key. It can increase or decrease the count, at the cost of a shuffle.
Learn it in “Partitions and parallelism” →

S

Salting
Adding a random number to a skewed key so its rows spread over several partitions, then combining the pieces afterwards.
Learn it in “Data skew” →
Schema
The names and types of a DataFrame's columns, which Spark uses to plan and optimise work.
Learn it in “RDDs, DataFrames and Datasets” →
Serverless Spark
Running Spark jobs without creating or sizing a cluster: the service provides and scales compute per job or session, such as EMR Serverless or AWS Glue.
Learn it in “Running Spark” →
Shuffle
Spark's way of regrouping data across partitions, for example so all rows with the same key end up together. It costs disk, serialisation and network time, and marks a stage boundary.
Learn it in “The shuffle” →
Shuffle file
The file a map-side task writes to its node's local disk during a shuffle, holding one block for each task in the next stage.
Learn it in “The shuffle” →
Shuffled hash join
A join that shuffles both tables by key, then builds an in-memory hash table from the smaller side in each partition. Skips sorting but uses more memory.
Learn it in “Join strategies” →
Small files problem
When a table is stored as huge numbers of tiny files, so listing, opening and closing them takes longer than reading the data.
Learn it in “Reading and writing files” →
Sort-merge join
A join that shuffles both tables by the join key, sorts each partition, then matches rows by walking the two sorted lists together. Spark's usual choice for two large tables.
Learn it in “Join strategies” →
Spark Connect
A client-server option, since Spark 3.4, in which a lightweight client sends DataFrame plans to a remote Spark cluster and receives results back.
Learn it in “Driver, executors and the cluster” →
Spark SQL
Spark's module for structured data. It runs both SQL queries and DataFrame code through the same optimiser and execution engine.
Learn it in “Spark SQL and the DataFrame API” →
Spark UI
The web interface every Spark driver serves (by default on port 4040), showing jobs, stages, tasks, SQL plans, storage and executors.
Learn it in “Jobs, stages and tasks” →
Spill
When a task runs short of execution memory and writes part of its working data to local disk, to read back later. Slower, but the task finishes.
Learn it in “Memory, spill and out-of-memory” →
Spot capacity
Spare cloud machines sold at a discount that the provider can take back at short notice, such as AWS Spot Instances or Google spot VMs.
Learn it in “Cost and right-sizing” →
Stage
A part of a job that can run without exchanging data between machines. Stages are separated by shuffles, and each runs one task per partition.
Learn it in “Jobs, stages and tasks” →
Storage level
How Spark keeps cached data: in memory, on disk or both; as objects or serialised bytes; with one copy or two. Chosen with persist().
Learn it in “Caching and persistence” →
Storage memory
The part of an executor's memory used for cached data and broadcast variables. Execution can evict it, but only down to a protected floor.
Learn it in “Memory, spill and out-of-memory” →
Straggler
A task that runs far longer than the others in its stage, holding up the whole stage.
Learn it in “Data skew” →
Structured Streaming
Spark's stream processing engine: you write a DataFrame query as if over a table, and Spark runs it incrementally as new rows arrive.
Learn it in “Structured Streaming” →

T

Task
The smallest unit of work in Spark: one operation on one partition of data, run by one executor.
Learn it in “Driver, executors and the cluster” →
Temporary view
A name given to a DataFrame so it can be queried with SQL. It lasts only for the current Spark session and stores no data.
Learn it in “Spark SQL and the DataFrame API” →
Transformation
An operation that defines a new DataFrame or RDD from an existing one, such as filter or select. It is added to Spark's plan but not run until an action needs the result.
Learn it in “Transformations, actions and laziness” →
Trigger
The setting that decides when a streaming query processes its next batch: back to back, on an interval, or once everything available is done.
Learn it in “Structured Streaming” →

U

UDF (user-defined function)
Your own function applied to DataFrame columns. In PySpark, a Python UDF runs in a separate Python process, so data has to be passed to it and back.
Learn it in “PySpark, Arrow and UDFs” →

V

Vectorised execution
Processing data in batches of rows stored column by column, so each call handles thousands of values in a tight loop.
Learn it in “Tungsten and vectorised engines” →
Volcano model
The classic way to run a query plan: each operator returns one row at a time when the operator above calls its next() method.
Learn it in “Tungsten and vectorised engines” →

W

Watermark
A moving threshold (latest event time seen minus an allowed delay) that tells a streaming query how late data may be. Older data is dropped and old state freed.
Learn it in “Structured Streaming” →
Whole-stage code generation
Spark's technique (since 2.0) of fusing a chain of operators into one generated, compiled function, marked *(n) in explain() output.
Learn it in “Tungsten and vectorised engines” →
Wide transformation
A transformation where an output partition needs data from many input partitions, like groupBy or most joins. It requires a shuffle and starts a new stage.
Learn it in “Transformations, actions and laziness” →

General terms · shared by every track

A

ACID
Four guarantees for transactions: Atomic (all or nothing), Consistent (rules hold), Isolated (concurrent work doesn't interfere), Durable (once done, it stays done).
Learn it in “ACID on object storage” →
Atomic
All or nothing. An atomic change either happens completely or not at all, and nobody ever sees it half done.
Think of it as: Handing over a sealed envelope: the other person has it or doesn't. There's no half-handed envelope.
Learn it in “Object storage: the ground floor” →

B

Batch processing
Processing data in scheduled chunks, such as every night or every hour.
Learn it in “Getting data in” →

C

CSV
Comma-separated values: plain text, one row per line. Easy to read, slow and large for analytics, and no schema.
Learn it in “Rows vs columns: file formats” →

I

Idempotent
Safe to run twice: running the job again gives the same result instead of duplicating data.
Learn it in “Medallion architecture” →

J

JSON
A text format of nested key-value objects, like {"id": 7}. Common for app events and APIs, and used by Delta's transaction log.
Learn it in “Rows vs columns: file formats” →

M

Metadata
Data about data: which files exist, their schema, sizes and statistics. Engines read metadata first to plan work.
Learn it in “What makes a table a table” →

S

Schema
The structure of a table: its column names and types, such as order_id: long, amount: decimal.
Learn it in “Schema evolution & enforcement” →
SQL
The standard language for querying tables: SELECT … FROM … WHERE …
Learn it in “Hands-on: query in your browser” →
Streaming
Processing data continuously as it arrives, within seconds or minutes.
Learn it in “Getting data in” →

T

Transaction
A group of changes that succeeds or fails as one unit.
Think of it as: A money transfer: debit one account and credit the other, or do neither.
Learn it in “ACID on object storage” →