Job Market Lakehouse: PySpark, Great Expectations and Airflow
A local-mode lakehouse pipeline over 60,000 synthetic job postings from 400 companies: PySpark transforms the raw data, Great Expectations gates the output, Airflow orchestrates the run, and a Scala Spark job adds a second aggregation.
- Result
- 11 data-quality checks gate every run
- Built for
- Analysts asking how salaries vary by industry and seniority, and which postings rank highest within an industry.
- Role
- Sole developer: design, build, tests and deployment
- When
- Sep 2026
How it works
- A seeded generator writes 60,000 postings and 400 companies as raw CSV
- PySpark joins postings to companies, aggregates salary statistics per industry and seniority, and ranks postings within each industry with dense_rank(); output is Parquet
- 11 Great Expectations checks (row counts, value sets, uniqueness, a cross-column max >= min rule) fail the run if any expectation fails
- An Airflow DAG runs generate, transform and validate, verified end to end with airflow dags test
- A Scala Spark job computes monthly posting volume by source
- A static HTML data-quality report is built from the expectation results and uploaded by CI
Data
Synthetic and seeded (data/generate_raw_data.py); it describes no real company.
Problems found and decisions made
- Airflow's dependency pins clashed with the pipeline's (pydantic, typing_extensions)
- Airflow runs in its own environment, separate from the pipeline's, in CI as well as locally.
- Validation needs to stop bad data, not just report it
- Any failed expectation fails the run, so nothing downstream sees an output that broke a rule.
- Library versions drifted: an unpinned pandas 3 and pyarrow 26 stopped importing against the numpy that Great Expectations needs
- CI flagged the break; pandas and pyarrow are now pinned to compatible ranges.
Testing and reliability
- CI runs the PySpark job, the Great Expectations validation and the unit tests on every push
- A second CI job installs Airflow and runs the DAG end to end
Results
- 11 expectations pass on every run
- A downloadable data-quality report from each CI run
Limits and next steps
- Runs Spark in local mode, not on a cluster
- The Scala job is run by hand against a Spark distribution rather than in CI