Introduzione a Databricks Lakehouse
Gang Wang
Senior Data Scientist
$$
my_project/
|-- databricks.yml
|-- src/
| |-- etl_pipeline.py
| |-- data_quality.py
|-- resources/
| |-- jobs/
| | |-- nightly_etl.yml
| |-- pipelines/
| |-- sales_pipeline.yml
|-- tests/
|-- test_etl.py
$$
databricks.yml - file di config principalesrc/ - notebook e codiceresources/ - definizioni di job e pipelinetests/ - file di test opzionalibundle:
name: sales_analytics
workspace:
host: https://myworkspace.databricks.com
targets:
dev:
default: true
workspace:
root_path: /Users/me/dev
production:
workspace:
root_path: /Shared/production
permissions:
- level: CAN_MANAGE
group_name: data_engineers
$$

$$
resources:
jobs:
nightly_etl:
name: "Nightly ETL Pipeline"
schedule:
quartz_cron: "0 0 2 * * ?"
tasks:
- task_key: ingest
notebook_task:
notebook_path: src/etl.py
$$
| Command | Scopo |
|---|---|
bundle validate |
Controlla la config per errori |
bundle deploy |
Esegue il deploy su un target |
bundle run |
Avvia un job distribuito |
bundle destroy |
Rimuove le risorse distribuite |
$$
# Valida prima del deploy
databricks bundle validate
# Deploy in produzione
databricks bundle deploy \
--target production
# Avvia un run
databricks bundle run nightly_etl

$$
$$
databricks.yml definisce progetto, target e risorsevalidate, deploy, run, destroyIntroduzione a Databricks Lakehouse