databricks
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseDatabricks
Databricks
Core skill for Databricks CLI, authentication, and data exploration.
Databricks CLI、认证及数据探索核心技能指南。
Product Skills
产品技能
For specific products, use dedicated skills:
- databricks-apps - Full-stack TypeScript app development and deployment
针对特定产品,请使用专用技能:
- databricks-apps - 全栈TypeScript应用开发与部署
Prerequisites
前置条件
-
CLI installed:
databricks --version- If not: see CLI Installation
-
Authenticated:
databricks auth profiles- If not: see CLI Authentication
-
已安装CLI:
databricks --version- 若未安装:请查看CLI安装文档
-
已完成认证:
databricks auth profiles- 若未完成:请查看CLI认证文档
Profile Selection - CRITICAL
配置文件选择 — 至关重要
NEVER auto-select a profile.
- List profiles:
databricks auth profiles - Present ALL profiles to user with workspace URLs
- Let user choose (even if only one exists)
- Offer to create new profile if needed
绝对不要自动选择配置文件。
- 列出配置文件:
databricks auth profiles - 向用户展示所有配置文件及对应的工作区URL
- 让用户选择(即使只有一个配置文件存在)
- 若需要,提供创建新配置文件的选项
Claude Code - IMPORTANT
Claude Code — 重要提示
Each Bash command runs in a separate shell session.
bash
undefined每个Bash命令在独立的Shell会话中运行。
bash
undefinedWORKS: --profile flag
WORKS: --profile flag
databricks apps list --profile my-workspace
databricks apps list --profile my-workspace
WORKS: chained with &&
WORKS: chained with &&
export DATABRICKS_CONFIG_PROFILE=my-workspace && databricks apps list
export DATABRICKS_CONFIG_PROFILE=my-workspace && databricks apps list
DOES NOT WORK: separate commands
DOES NOT WORK: separate commands
export DATABRICKS_CONFIG_PROFILE=my-workspace
databricks apps list # profile not set!
undefinedexport DATABRICKS_CONFIG_PROFILE=my-workspace
databricks apps list # profile not set!
undefinedData Exploration — Use AI Tools
数据探索 — 使用AI工具
Use these instead of manually navigating catalogs/schemas/tables:
bash
undefined请使用以下工具替代手动导航目录/模式/表:
bash
undefineddiscover table structure (columns, types, sample data, stats)
discover table structure (columns, types, sample data, stats)
databricks experimental aitools tools discover-schema catalog.schema.table --profile <profile>
databricks experimental aitools tools discover-schema catalog.schema.table --profile <profile>
run ad-hoc SQL queries
run ad-hoc SQL queries
databricks experimental aitools tools query "SELECT * FROM table LIMIT 10" --profile <profile>
databricks experimental aitools tools query "SELECT * FROM table LIMIT 10" --profile <profile>
find the default warehouse
find the default warehouse
databricks experimental aitools tools get-default-warehouse --profile <profile>
See [Data Exploration](data-exploration.md) for details.databricks experimental aitools tools get-default-warehouse --profile <profile>
详情请查看[数据探索文档](data-exploration.md)。Quick Reference
快速参考
⚠️ CRITICAL: Some commands use positional arguments, not flags
bash
undefined⚠️ 重要提示:部分命令使用位置参数,而非标志参数
bash
undefinedcurrent user
当前用户信息
databricks current-user me --profile <profile>
databricks current-user me --profile <profile>
list resources
列出资源
databricks apps list --profile <profile>
databricks jobs list --profile <profile>
databricks clusters list --profile <profile>
databricks warehouses list --profile <profile>
databricks pipelines list --profile <profile>
databricks serving-endpoints list --profile <profile>
databricks apps list --profile <profile>
databricks jobs list --profile <profile>
databricks clusters list --profile <profile>
databricks warehouses list --profile <profile>
databricks pipelines list --profile <profile>
databricks serving-endpoints list --profile <profile>
⚠️ Unity Catalog — POSITIONAL arguments (NOT flags!)
⚠️ Unity Catalog — POSITIONAL arguments (NOT flags!)
databricks catalogs list --profile <profile>
databricks catalogs list --profile <profile>
✅ CORRECT: positional args
✅ 正确用法:位置参数
databricks schemas list <catalog> --profile <profile>
databricks tables list <catalog> <schema> --profile <profile>
databricks tables get <catalog>.<schema>.<table> --profile <profile>
databricks schemas list <catalog> --profile <profile>
databricks tables list <catalog> <schema> --profile <profile>
databricks tables get <catalog>.<schema>.<table> --profile <profile>
❌ WRONG: these flags/commands DON'T EXIST
❌ 错误用法:以下标志/命令不存在
databricks schemas list --catalog-name <catalog> ← WILL FAIL
databricks schemas list --catalog-name <catalog> ← 执行失败!
databricks tables list --catalog <catalog> ← WILL FAIL
databricks tables list --catalog <catalog> ← 执行失败!
databricks sql-warehouses list ← doesn't exist, use warehouses list
warehouses listdatabricks sql-warehouses list ← 不存在,请使用warehouses list
warehouses listdatabricks execute-statement ← doesn't exist, use experimental aitools tools query
experimental aitools tools querydatabricks execute-statement ← 不存在,请使用experimental aitools tools query
experimental aitools tools querydatabricks sql execute ← doesn't exist, use experimental aitools tools query
experimental aitools tools querydatabricks sql execute ← 不存在,请使用experimental aitools tools query
experimental aitools tools queryWhen in doubt, check help:
如有疑问,请查看帮助:
databricks schemas list --help
databricks schemas list --help
get details
获取资源详情
databricks apps get <name> --profile <profile>
databricks jobs get --job-id <id> --profile <profile>
databricks clusters get --cluster-id <id> --profile <profile>
databricks apps get <name> --profile <profile>
databricks jobs get --job-id <id> --profile <profile>
databricks clusters get --cluster-id <id> --profile <profile>
bundles
资源包操作
databricks bundle init --profile <profile>
databricks bundle validate --profile <profile>
databricks bundle deploy -t <target> --profile <profile>
databricks bundle run <resource> -t <target> --profile <profile>
undefineddatabricks bundle init --profile <profile>
databricks bundle validate --profile <profile>
databricks bundle deploy -t <target> --profile <profile>
databricks bundle run <resource> -t <target> --profile <profile>
undefinedTroubleshooting
故障排除
| Error | Solution |
|---|---|
| Use |
| Check workspace/UC permissions |
| Verify resource name/id and profile |
| 错误信息 | 解决方案 |
|---|---|
| 使用 |
| 检查工作区/UC权限 |
| 验证资源名称/ID及配置文件是否正确 |
Required Reading by Task
按任务分类的必读文档
| Task | READ BEFORE proceeding |
|---|---|
| First time setup | CLI Installation |
| Auth issues / new workspace | CLI Authentication |
| Exploring tables/schemas | Data Exploration |
| UC permissions/volumes | Unity Catalog |
| Deploying jobs/pipelines | Asset Bundles |
| 任务 | 操作前必读 |
|---|---|
| 首次设置 | CLI安装文档 |
| 认证问题 / 新增工作区 | CLI认证文档 |
| 表/模式探索 | 数据探索文档 |
| UC权限/卷管理 | Unity Catalog文档 |
| 作业/流水线部署 | 资源包文档 |
Reference Guides
参考指南
- CLI Installation
- CLI Authentication
- Data Exploration
- Unity Catalog
- Asset Bundles
- Jobs
- LakeFlow
- Model Serving
- DBSQL
- Clusters
- Workspace
- Secrets
- DBFS (legacy - prefer UC Volumes)
- AI/BI Dashboards
- Genie
- CLI安装文档
- CLI认证文档
- 数据探索文档
- Unity Catalog文档
- 资源包文档
- 作业文档
- LakeFlow文档
- 模型服务文档
- DBSQL文档
- 集群文档
- 工作区文档
- 密钥管理文档
- DBFS文档(旧版 - 推荐使用UC Volumes)
- AI/BI仪表盘文档
- Genie文档