Skip to main content
PYSPARK • LESSON 23

Generic Ingestion with read.format()

How do we use Spark's unified Data Source API format() and load() methods?

Beginner2 Minutes195 XP
🤔 THE QUESTION

How do we use Spark's unified Data Source API format() and load() methods?

💡 WHAT IS IT?

read.format().load() is the standardized generic entry point supporting Parquet, ORC, Delta, Avro, and JDBC.

🎯 WHAT IS IT USED FOR?

Building parameterized, format-agnostic ingestion pipelines across diverse lakehouse storage layers.

💻 EXAMPLE
df = spark.read.format("parquet") \
    .load("data/warehouse/dim_customers")

🎯 Mission Objectives

Practice typing production-grade PySpark code for Generic Ingestion with read.format().

  • Use generic read.format() API
  • Specify target data format
  • Load dimension customer data