Databricks Lakehouse 入門
Gang Wang
Senior Data Scientist
$$

$$
# Default language: Python
df = spark.table("silver_taxi_trips")
display(df)
%sql
SELECT COUNT(*) AS total_trips
FROM silver_taxi_trips
%md
## Analysis notes
Revenue is **highest** in the Northeast region.
$$
| Command | Purpose |
|---|---|
%python |
執行 Python 程式碼 |
%sql |
執行 SQL 查詢 |
%scala |
執行 Scala 程式碼 |
%r |
執行 R 程式碼 |
%md |
轉譯 Markdown |
%sh |
執行 shell 指令 |
$$

$$
%run 會在「相同脈絡」執行另一個 notebook$$
# 載入共用輔助函式
%run /Shared/utils/data_helpers
# 現在可使用 data_helpers 中
# 定義的函式
clean_df = clean_nulls(raw_df)
$$
$$

$$
%run 可將其他 notebook 的函式載入到你的工作階段Databricks Lakehouse 入門