Data engineering
Rebuilding the NYC taxi data lake
Can a taxi-data pipeline absorb a schema change and rerun safely while reducing the files needed for a daily query?
Solution
I reconciled two taxi schemas in Spark, replayed the HDFS backfill and compared two Parquet layouts.
My contribution · I implemented schema reconciliation and quarantine in Spark, replayed the HDFS backfill and tested day partitioning.
Tools PySpark · Spark SQL · Parquet · Airflow · HDFS
Results
For one service day, Spark selected 1.85 MB of candidate files versus 112.44 MB in the flat layout. The aggregates matched.
After replay, the HDFS snapshot still contained 7,003,656 eligible trips and 139,941 quarantined records.
- Candidate bytes, one service day
- 1.85 MB Source
Data & evaluation
Data sources
- NYC TLC Yellow Taxi Parquet releases for December 2024 and January 2025
Method
- Normalize the two schemas, quarantine invalid rows, write both layouts, then replay the same backfill into HDFS.
- Preserve the newly introduced fare column as null in earlier trips. Reconcile counts and decimal fare sums before comparing files selected by Spark.
Limitations
The comparison covers one date and a local Spark runner. Candidate bytes describe eligible files before column and row-group pruning.
Wall-clock gains, cloud costs and behavior under production load require separate benchmarks across dates, data volumes and environments.
Reproduce the study
Use Python 3.11 or newer and Docker Compose. Prepare the designated TLC snapshots, then run the Spark job and check the aggregates and partition results.
Local reproduction instructions and pinned sourceSkills demonstrated
- Schema evolution
- Replay-safe pipelines
- Query-plan analysis
Project figures

The partitioned layout considered 1.85 MB of candidate files against 112.44 MB for the flat layout on a single date.
Idriss Lemnouni. Source data from the NYC Taxi and Limousine Commission.Figure source
After replay, the snapshot contained 7,003,656 eligible trips and 139,941 quarantined records across the two months.
Idriss Lemnouni. Source data from the NYC Taxi and Limousine Commission.Figure source