AWS › AWS Glue & ETL

How do Glue jobs use Apache Spark under the hood to perform large scale data transformations?

Intermediate

Answer

A Glue job runs on a fully managed, serverless Apache Spark environment, meaning you write transformation logic using Python or Scala, often generated automatically by Glue's visual job editor or written manually, and Glue automatically provisions the necessary Spark cluster resources to execute that job at scale, processing potentially massive datasets in parallel without you needing to manually configure or manage any Spark infrastructure yourself.
import sys
from awsglue.transforms import *
from awsglue.context import GlueContext

glueContext = GlueContext(SparkContext.getOrCreate())
datasource = glueContext.create_dynamic_frame.from_catalog(database='my_db', table_name='raw_sales')
Real-world example A data engineering team writes a Glue job using PySpark to join and aggregate several large datasets stored in S3, relying on Glue's underlying Spark engine to distribute that processing efficiently across multiple worker nodes automatically.

Common follow-ups: What is a DynamicFrame in Glue and how does it differ from a Spark DataFrame?;How do you control the number of Spark workers allocated to a Glue job?