Skip to main content
KUSHAL SRINIVAS OP-2026
[ENGINEERING RECORD · DATA WAREHOUSE]

Zomato ETL Warehouse — 35.1M-Row Medallion Model in dbt & DuckDB

dbtDuckDBSQLPythonStar SchemaSCD Type 2

Raw food-delivery exports are notoriously inconsistent: currency text mixed with serving-size labels ("₹200 FOR TWO"), sentinel strings ("--", "Too Few Ratings", "license"), approximate count buckets ("50+ ratings", "1K+ ratings"), and quoted headers with spaces. Zomato ETL Warehouse models 35.1 million raw rows into a clean Bronze → Silver → Star-Schema Mart + SCD Type-2 warehouse using dbt-core 1.12.7 and DuckDB 2.0.1 running entirely locally.

35.1M
Raw rows transformed
7 CSVs · 2.27 GB → 1.59 GiB DuckDB
22
dbt models & snapshots
7 Silver · 10 Star · 4 Gold/Mart · 1 SCD2
10.4 s
19-model dbt build
Single-thread local DuckDB (threads: 1)
100%
Menu prices parsed
1,179,936 / 1,179,936 · 0 nulls

Medallion & Star-Schema Layout

[WAREHOUSE LINEAGE]

Bronze main.* (7 raw tables, 35.1M rows) → Silver silver.* (7 typed & cleaned views) → Star Schema mart.* (7 dimensions + 3 facts) → Gold & Business Marts (gold.gold_daily_sales, mart_daily_city_revenue, mart_restaurant_performance, mart_delivery_sla) + snapshot.zomato_snapshot (SCD Type-2) = 22 dbt models & snapshots

Raw source volume loaded into DuckDB (2.27 GB across 7 CSV files)
TableRowsRole in Warehouse
order_items22,998,179Line-item fact table grain (fact_order_items)
orders10,000,00030-month order stream (2024-01-01 to 2026-06-30; 0 orphan restaurant joins)
menu1,179,936Restaurant-to-dish pricing catalog (all-VARCHAR raw source)
food371,561Dish catalog (270,776 Veg · 100,784 Non-veg · 1 blank)
reviews300,000Order review fact table (fact_reviews)
restaurant148,541Restaurant dimension + SCD Type-2 tracked entity
users100,000User dimension with parsed income min/max bounds

Silver-Layer Data Cleaning Rules

Every transformation stays readable and deterministic in SQL views so raw Bronze tables remain immutable and auditable:

  • silver_restaurant: Nulled 87,014 "--" ratings and 87,014 "Too Few Ratings" placeholders, parsed 61,441 lower-bound approximate count strings (50+ / 1K+), stripped currency symbols from cost-for-two (131 nulls preserved), and nulled 12,861 literal "license" placeholder strings.
  • silver_menu: Applied regex extraction and try_cast over an all-VARCHAR source — parsing all 1,179,936 rows with 0 null prices while flagging 1,193 rows with price_is_for_two = true.
  • silver_users & silver_food: Normalised quoted headers with spaces to snake_case, extracted numeric monthly_income_min/monthly_income_max bounds from bracket text, and cast vegetarian flags to typed booleans.

Marts, SCD Type-2 & Observed Local Build Times

Single-thread local dbt build timings from zomato/logs/dbt.log (threads: 1, DuckDB 2.0.1)
Model / RunOutput RowsObserved DurationWhat It Computes
19-model full run (Silver + Star + daily revenue)35M+ scanned~10.4 s7 Silver views, 7 dims, 3 facts (fact_orders 2.4–4.4 s, fact_order_items 3.9–4.3 s), gold_daily_sales, mart_daily_city_revenue (0.99 s)
mart_restaurant_performance148,5411.19 sDelivered revenue, gross sales, avg rating, and avg delivery minutes per restaurant
mart_delivery_sla4,416,24016.01 sExact p50 and p90 quantile_cont delivery minutes grouped by date × 821 cities × hour over 9.15M delivered rows
zomato_snapshot (SCD Type 2)148,5410.94 sstrategy='check' tracking name, city, rating, rating_count, cost, and cuisine changes

Read next: Web Research Engine and The Churn Cliff (data report).

BACK TO ALL ENTRIES