| name | databricks-hello-world |
| description | Create a minimal working Databricks example with cluster and notebook.
Use when starting a new Databricks project, testing your setup,
or learning basic Databricks patterns.
Trigger with phrases like "databricks hello world", "databricks example",
"databricks quick start", "first databricks notebook", "create cluster".
|
| allowed-tools | Read, Write, Edit, Bash(databricks:*), Bash(python:*) |
| version | 1.0.0 |
| license | MIT |
| author | Jeremy Longshore <jeremy@intentsolutions.io> |
| compatible-with | claude-code, codex, openclaw |
| tags | ["saas","databricks","testing"] |
Databricks Hello World
Overview
Create your first Databricks cluster and notebook via the REST API and Python SDK. Covers single-node dev clusters, SQL warehouses, notebook upload, one-time job runs, and Delta Lake smoke tests.
Prerequisites
- Completed
databricks-install-auth setup
- Workspace access with cluster creation permissions
- Valid API credentials in env vars or
~/.databrickscfg
Instructions
Step 1: Create a Single-Node Dev Cluster
databricks clusters create --json '{
"cluster_name": "hello-world-dev",
"spark_version": "14.3.x-scala2.12",
"node_type_id": "i3.xlarge",
"autotermination_minutes": 30,
"num_workers": 0,
"spark_conf": {
"spark.databricks.cluster.profile": "singleNode",
"spark.master": "local[*]"
},
"custom_tags": {
"ResourceClass": "SingleNode"
}
}'
Or via Python SDK:
from databricks.sdk import WorkspaceClient
from databricks.sdk.service.compute import AutoScale
w = WorkspaceClient()
cluster = w.clusters.create_and_wait(
cluster_name="hello-world-dev",
spark_version="14.3.x-scala2.12",
node_type_id="i3.xlarge",
num_workers=0,
autotermination_minutes=30,
spark_conf={
"spark.databricks.cluster.profile": "singleNode",
"spark.master": "local[*]",
},
)
print(f"Cluster ready: {cluster.cluster_id} ({cluster.state})")
Step 2: Create and Upload a Notebook
import base64
from databricks.sdk import WorkspaceClient
from databricks.sdk.service.workspace ImportFormat, Language
w = WorkspaceClient()
notebook_source =
me = w.current_user.me()
notebook_path =
w.workspace.import_(
path=notebook_path,
=ImportFormat.SOURCE,
language=Language.PYTHON,
content=base64.b64encode(notebook_source.encode()).decode(),
overwrite=,
)
()