After creating the Raw Schema and External Volume, the next step is to ingest raw source files into the Bronze Layer of the Medallion Architecture.
This notebook reads raw datasets from the Unity Catalog Volume, validates the data using predefined schemas, enriches it with ingestion metadata, and stores it as Delta tables in the Bronze schema.
The Bronze layer preserves the original source data with minimal transformation, providing a reliable foundation for downstream Silver layer processing.
After completing this guide, you will be able to:
Azure Data Lake Storage Gen2
│
Container: ecomm-raw-data
│
┌────────────────────┴────────────────────┐
▼ ▼
Dimension Data Fact Data
(raw.raw_landing) (order_items/landing)
│ │
▼ ▼
Bronze Dimension Notebook Bronze Streaming Notebook
│ │
Apply Schema Auto Loader
Add Metadata Structured Streaming
│ Checkpointing
└───────────────┬─────────────────────────┘
▼
Bronze Delta Tables
│
┌──────────────────────────────────────┐
▼ ▼
Dimension Tables Fact Tables
• brz_brands • brz_order_items
• brz_category
• brz_products
• brz_customers
• brz_calendar
The Bronze layer ingests both dimension datasets and streaming fact data.
Example directory structure:
raw_landing
│
├── brands/
│ └── brands.csv
│
├── calendar/
│ └── calendar.csv
│
├── category/
│ └── category.csv
│
├── customers/
│ └── customers.csv
│
└── products/
└── products.csv
order_items/
└── landing/
├── order_items_001.csv
├── order_items_002.csv
└── ...
The Bronze notebooks perform the following tasks:
Each Bronze table contains additional metadata columns.
| Column | Description |
|---|---|
_ingested_at |
Timestamp when the record was loaded |
_source_file |
Source file name |
_ingest_time |
Notebook execution timestamp |
These metadata columns help with:
After successful execution, the following Delta tables are created.
| Bronze Table | Type | Description |
|---|---|---|
| brz_brands | Dimension | Product brand master data |
| brz_calendar | Dimension | Calendar dimension |
| brz_category | Dimension | Product category dimension |
| brz_customers | Dimension | Customer master data |
| brz_products | Dimension | Product master data |
| brz_order_items | Fact | Streaming order item transaction data |
The notebook is organized into the following sections.
Imports the required PySpark SQL modules.
from pyspark.sql.types import *
from pyspark.sql import functions as F
Defines the catalog used throughout the notebook.
catalog_name = "ecommerce"
Specifies the raw landing location for each dataset stored in the Unity Catalog Volume.
Example:
/Volumes/ecommerce/raw/raw_landing/category/
Creates explicit Spark schemas for each dimension dataset.
Using predefined schemas ensures:
Reads source files using Spark.
Example:
spark.read.csv(...)
Adds ingestion metadata columns before writing.
Example columns:
Writes data as managed Delta tables.
Example:
df.write.format("delta") \
.mode("overwrite") \
.saveAsTable("ecommerce.bronze.brz_category")
This guide is implemented using the following notebook.
| Notebook | Description |
|---|---|
| 📘 Ingest Dimensions | Reads raw dimension datasets and creates Bronze Delta tables. |
| 📘 Ingest order_items fact | Uses Databricks Auto Loader and Structured Streaming to ingest order item transactions into the Bronze layer. |
Unity Catalog
│
└── ecommerce
│
├── raw
│ │
│ └── raw_landing
│
└── bronze
│
├── brz_brands
├── brz_calendar
├── brz_category
├── brz_customers
├── brz_products
└── brz_order_items
Source Systems
│
┌───────────────────────────┴───────────────────────────┐
▼ ▼
Dimension Data Transaction Data
(Unity Catalog Volume) (ADLS Gen2 Landing Zone)
│ │
▼ ▼
Databricks Auto Loader
Bronze Dimension Notebooks +
Structured Streaming
│ │
▼ ▼
Read Source Files Read Streaming Files
Data Validation Incremental Ingestion
Schema Validation Schema Inference
Add Metadata Columns Add Metadata Columns
Write Bronze Delta Tables Write Bronze Delta Table
│ │
└───────────────────────────┬───────────────────────────┘
▼
Bronze Delta Tables
│
┌───────────────────────────┼───────────────────────────┐
▼ ▼ ▼
Dimension Tables Fact Tables Unity Catalog
• brz_brands • brz_order_items Registration
• brz_category
• brz_products
• brz_customers
• brz_calendar
│
▼
Silver Layer
| Component | Status |
|---|---|
| Raw Files Read Successfully | ✅ |
| Schemas Applied | ✅ |
| Metadata Added | ✅ |
| Bronze Tables Created | ✅ |
| Delta Format Used | ✅ |
| Data Available in Catalog | ✅ |
The notebook successfully ingests dimension datasets into the Bronze layer.

After execution, the tables are available in the bronze schema.
