Data transformeren

Introductie tot Databricks SQL

Kevin Barlow

Data Manager

Motivatie

Lakehouse Flow - Inname

Introductie tot Databricks SQL

Transformatie in de lakehouse

Lakeflow-diagram - Transformatie

Introductie tot Databricks SQL

Data opschonen en transformeren

  • Data opschonen van Bronze (ruw) naar Silver (analytics‑klaar)
  • Belangrijke stap voor downstream-tabellen
  • Veelvoorkomende taken
    • NULL‑waarden verwijderen
    • Waarden standaardiseren
    • Datatypen aanpassen
CREATE TABLE silver_layer AS (
SELECT DISTINCT c.id, 
    c.last_name || ', ' || c.first_name 
        AS name, 
    format(s.date,'YYYY-mm-dd') 
        AS sale_date, 
    round(s.price, 2) 
        AS sale_price
    s.item_name
FROM sales_data s
LEFT JOIN contacts c on c.id = s.id)
Introductie tot Databricks SQL

Data aggregeren

  • Data uit de Silver‑laag combineren en versimpelen naar Gold (BI‑klaar)
  • Gericht op een specifieke BI‑behoefte
    • Goede kandidaat voor views
  • Veelvoorkomende taken
    • Overbodige kolommen verwijderen
    • Aggregaties over dimensies
    • Metrics/KPI’s berekenen
CREATE VIEW q3_revenue AS (
SELECT sum(revenue) AS total_rev,
  count(*) AS total_count,
  total_rev / total_count AS avg_sale,
  category,
  item
FROM silver_layer
WHERE date BETWEEN '2024-07-01' 
  AND '2024-09-30'
GROUP BY category, item)
Introductie tot Databricks SQL

Taken automatiseren

Workflows GIF

Introductie tot Databricks SQL

Laten we oefenen!

Introductie tot Databricks SQL

Preparing Video For Download...