Unit 2 Cloud Pipelines Notes
Understanding the Data Pipeline Workflow
Learn how data moves from a raw, messy file through validation, cleaning, and transformation before becoming a reliable output that businesses can actually use.
Learning Objectives
- Explain the three states of data in a pipeline — raw, processed, and final output — and what distinguishes each
- Identify the four common problems found in raw business data and why they must be resolved before use
- Trace the full lifecycle of data through a pipeline: raw file, validation, cleaning, transformation, and final table
- Run hands-on Python code in Databricks that simulates each stage of the cleaning process
- Explain the distinct roles of Databricks and AWS Lambda within the data lifecycle
Every piece of data that enters a pipeline passes through three distinct states before it is ready for business use. Understanding these states is the foundation for understanding why pipelines exist and what each component is responsible for.
| Problem | What It Looks Like | Why It Causes Issues |
|---|---|---|
| Missing values | A cell in the “Sales Amount” column is blank | Calculations using that column will fail or produce incorrect totals |
| Inconsistent formatting | Dates written as 01/03/2024, March 1 2024, and 2024-03-01 in the same column | The system cannot sort or filter by date reliably |
| Duplicate records | The same transaction row appears twice in the file | Reports will double-count values, producing inflated figures |
| Incorrect data types | A numeric sales amount stored as text (“1,200” instead of 1200) | Math operations will fail because the system treats the value as a word, not a number |
Feeding raw data into a dashboard or report without cleaning it first produces unreliable results. A missing sales figure skews a total. A duplicate record inflates a count. A badly formatted date breaks a sort. The cleaning stage exists specifically to catch and correct these issues before the data reaches anyone who relies on it to make decisions.
A data pipeline is not a single step — it is a sequence of stages, each with a defined purpose. Data enters at the top as a raw file and exits at the bottom as a clean, structured table. Every stage either checks the data, changes it, or moves it forward.
Think of Lambda as a smoke detector and Databricks as the fire suppression system. The smoke detector does not put out the fire — it detects the event and activates the system that does. Lambda detects the file and activates Databricks. Each tool has one job, and together they produce a fully automated response.
Open your Databricks notebook from Unit 1 or create a new one named Unit2_Pipeline_Lifecycle. You will run three cells in sequence, each representing one stage of the pipeline.
[“Alice”, 500],
[“Bob”, None],
[“Charlie”, 700]
]
print(data)
data = […] creates a variable called data that holds a list. Each item inside the list is itself a list representing one row — a name and a sales amount. None is Python’s way of representing a missing value. Bob’s sales figure does not exist. This is the raw state: real data, real problem. The print statement displays the full list so you can see the missing value before any cleaning happens.
for row in data:
if row[1] is not None:
clean_data.append(row)
print(clean_data)
clean_data = [] creates an empty list that will hold only the valid rows after cleaning. for row in data: loops through every row in the original data list one at a time. if row[1] is not None: checks whether the second item in that row (the sales amount, at position 1) is a real value rather than a missing one. If the value exists, clean_data.append(row) adds that row to the clean list. Bob’s row fails the check — his amount is None — so it is skipped. Alice and Charlie pass, so they are included. The result is a cleaned dataset with no missing values.
In a real pipeline, this final step would write the clean_data to a Delta table stored in Databricks — a permanent, queryable output. For now, the print statement confirms that the pipeline has completed its processing. In later units, you will replace this confirmation message with an actual write command that saves the clean data to a table.
These three cells represent the core logic of a data pipeline in miniature: create raw data with a problem, apply a cleaning rule that removes the problem, and confirm that clean output has been produced. Every real pipeline follows this same pattern — just at much larger scale and with many more rules.
Data quality is not a technical concern — it is a business concern. Every decision made from a dashboard, every report sent to leadership, and every forecast produced by an analytics team depends on the reliability of the data underneath it. When that data is raw and uncleaned, the decisions built on it are unreliable.
When a person cleans data manually, the rules they apply depend on their interpretation, their attention level, and their availability. Two analysts following the same instructions will produce slightly different results. An automated pipeline applies exactly the same rules every single time — no variation, no fatigue, no missed steps.
Think of a situation in your own work or studies where you have relied on a report, a table, or a data summary to make a decision. How would that decision have changed if the underlying data contained missing values or duplicates? What would it have taken to catch the error before the decision was made?
Knowledge Check
Five questions covering the key concepts from Unit 2. Select the best answer for each question.
1. What is the correct order of stages in the data pipeline lifecycle covered in this unit?
2. In the cleaning code from this unit, what does if row[1] is not None check for?
3. What is the role of AWS Lambda in the data lifecycle?
4. Which of the following best describes “processed data” in the three-state model?
5. Why does automated cleaning produce more consistent results than manual cleaning?
Unit 2 Summary
What you covered in this unit
Raw data has problems. Processed data has been cleaned. Final output data is reliable and ready for business use.
Data passes through five stages: raw file, validation, cleaning, transformation, and final table. Each stage has a defined purpose.
Databricks reads, cleans, and transforms the data. The notebook code defines the rules applied at each processing stage.
Lambda detects that a new file has arrived and triggers the Databricks workflow. It moves data between stages — it does not process data itself.