databricks-core
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-jobs - Lakeflow Jobs development and deployment
- databricks-pipelines - Lakeflow Spark Declarative Pipelines (batch and streaming data pipelines)
- databricks-apps - Full-stack TypeScript app development and deployment
- databricks-lakebase - Lakebase Postgres Autoscaling project management
- databricks-model-serving - Model Serving endpoint management and inference
针对特定产品,请使用专用技能:
- databricks-jobs - Lakeflow Jobs 开发与部署
- databricks-pipelines - Lakeflow Spark 声明式流水线(批处理和流处理数据流水线)
- databricks-apps - 全栈 TypeScript 应用开发与部署
- databricks-lakebase - Lakebase Postgres 自动扩缩容项目管理
- databricks-model-serving - 模型服务端点管理与推理
Prerequisites
前置要求
-
CLI installed: Runto check.
databricks --version- If the CLI is missing or outdated (< v0.292.0): STOP. Do not proceed or work around a missing CLI.
- Read the CLI Installation reference file and follow the instructions to guide the user through installation.
- Note: In sandboxed environments (Cursor IDE, containers), install commands write outside the workspace and may be blocked. Present the install command to the user and ask them to run it in their own terminal.
-
Authenticated:
databricks auth profiles- If not: see CLI Authentication
-
已安装CLI:运行检查。
databricks --version- 如果CLI缺失或版本过旧(< v0.292.0):立即停止。不要继续操作,也不要尝试绕过缺失的CLI。
- 阅读CLI安装参考文件,按照说明引导用户完成安装。
- 注意:在沙箱环境(Cursor IDE、容器)中,安装命令的写入位置在工作区之外,可能会被阻止。请向用户提供安装命令,要求他们在自己的终端中运行。
-
已完成身份认证:执行验证
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请使用以下命令,不要手动遍历 catalog/schema/表:
bash
undefineddiscover 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
运行即席SQL查询
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
获取默认仓库
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 — 位置参数(不是参数标志!)
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
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 |
| Deploying jobs/pipelines | Use |
| 任务 | 操作前必读 |
|---|---|
| 首次设置 | CLI安装 |
| 认证问题 / 新工作区配置 | CLI身份认证 |
| 探查表/模式 | 数据探查 |
| 部署作业/流水线 | 使用 |
Reference Guides
参考指南
- CLI Installation
- CLI Authentication
- Data Exploration
- CLI安装
- CLI身份认证
- 数据探查