liveBook · Manning

Spark

As explained in Data Pipelines with Apache Airflow, Second Edition

Apache Spark is an open-source distributed computing engine for large-scale data processing and analytics.

Apache Spark is a distributed data-processing engine for workloads too large or resource-intensive for the machine running Airflow. A strong separation keeps Airflow responsible for starting and monitoring a job while Spark performs the actual processing on dedicated machines. section 8.3.3 section 13.4

Choose an Airflow launch path according to where Spark is available and what configuration the Airflow environment can access:

  • Use SparkSubmitOperator when the Airflow machine has the spark-submit binary and YARN client configuration needed to locate the Spark instance. section 8.3.3
  • Use SSHOperator when Airflow can connect securely to a Spark machine but does not have Spark client configuration locally. section 8.3.3
  • Use SimpleHTTPOperator when Livy, Spark's REST API, is running and exposes the job submission endpoint. section 8.3.3
  • For smaller datasets, use pandas through PythonOperator instead; unlike Spark, that processing consumes the Airflow machine's resources. section 13.4

Citi Bike and Yellow Cab transformations

After downloading Citi Bike and Yellow Cab data, trigger a Spark job with SparkSubmitOperator or another Airflow operator. The job reads the datasets from S3, transforms station coordinates and taxi zones for accurate comparison, and writes the results back to S3. For data that fits on one machine, pandas is the smaller-scale alternative. section 13.4

How Data Pipelines with Apache Airflow, Second Edition covers it

How deep it goes
Explains deployment choices and resource trade-offs but stops short of Spark job implementation details.
Examples
Uses Citi Bike and Yellow Cab transformations, with input from S3 and transformed output written back to S3.
What it assumes
Assumes familiarity with Airflow operators, distributed processing, and S3-style data movement.
What you can do after
Operate/configure Spark jobs through SparkSubmitOperator, SSHOperator, SimpleHTTPOperator, or another Airflow trigger.
How it connects
Connects Spark with Airflow, distributed computing, S3, YARN, Livy, SSH, pandas, and Kubernetes.

Also explained in

Compare how 5 books explain Spark →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Data Pipelines with Apache Airflow, Second Edition. The section links point to the parts of the book it draws on.