Pattern comuni di data engineering

Introduzione a Databricks SQL

Kevin Barlow

Data Manager

Motivazione

Diagramma Lakehouse - Trasformazione

Introduzione a Databricks SQL

Gestire i dati in arrivo

Append incrementale

  • Aggiungi tutti i nuovi dati in fondo alla tabella esistente
    INSERT INTO students 
    TABLE visiting_students;
    

Diagramma Append incrementale

Change Data Capture (CDC)

  • Integra i dati nella tabella esistente
    MERGE INTO target USING source
    ON target.key = source.key
    WHEN MATCHED THEN UPDATE SET *;
    

Diagramma CDC

Introduzione a Databricks SQL

Ottimizzazione dei dati

OPTIMIZE

  • Compattta un sottoinsieme di dati
  • Riduce il "problema dei piccoli file"

Z-ORDER

  • Simile agli indici nei database
  • Coloca i dati correlati negli stessi file
  • Può ridurre i tempi di lettura
> OPTIMIZE table_name;

> OPTIMIZE table_name 
    WHERE date >= '2024-01-01';

> OPTIMIZE table_name
    WHERE date >= current_timestamp() 
        - INTERVAL 1 day
    ZORDER BY (eventType);
Introduzione a Databricks SQL

Let's practice!

Introduzione a Databricks SQL

Preparing Video For Download...