liveBook · Manning

PySpark

As explained in Architecting an Apache Iceberg Lakehouse

PySpark is the Python API for Apache Spark distributed data processing.

PySpark is the Python API for Apache Spark distributed data processing. In an Iceberg lakehouse pipeline, it provides the executable layer that reads PostgreSQL data and writes Iceberg tables to object storage. section 3.3.2 section 3.3.3

A practical PySpark setup connects:

Starting an Iceberg ingestion session

Define the Nessie catalog URI, S3 warehouse path, and MinIO storage address; configure Spark packages and extensions; then create a SparkSession with spark.jars.packages and SparkSession.builder. section 3.3.3

import pyspark 
from pyspark.sql import SparkSession #1

## DEFINE VARIABLES #2
CATALOG_URI = "http://nessie:19120/api/v1"
WAREHOUSE = "s3://warehouse/"
STORAGE_URI = "http://<minio_ip>:9000"

Use the compact initialization listing to inspect the imports and connection variables required before configuring the Spark session. section 3.3.3

How Architecting an Apache Iceberg Lakehouse covers it

How deep it goes
Configures imports, connection variables, packages, extensions, catalogs, and a Spark session, stopping short of full transformation logic.
Examples
Uses a Jupyter notebook, Docker network inspection, MinIO warehouse bucket, and an Iceberg ingestion SparkSession.
What it assumes
Assumes a Docker environment with Spark, Jupyter, MinIO, and Nessie, while identifying required network addresses and connection settings.
What you can do after
Apply PySpark by launching a configured Spark session that can access Nessie and MinIO for Iceberg ingestion.
How it connects
Connects Apache Spark with Apache Iceberg, Project Nessie, MinIO, S3-compatible storage, and PostgreSQL JDBC.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Architecting an Apache Iceberg Lakehouse. The section links point to the parts of the book it draws on.