databricks-data-discovery
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseDatabricks Data Discovery
Databricks 数据发现
This skill routes data work — decide first:
- the request is about the data — finding it, asking questions of it, or
generating SQL → delegate to Genie One:
(see Routing below).
databricks genie ask -s <session-label> "..." - writing files or anything else → use your own coding-agent tools.
Genie One just needs an authenticated CLI profile (the parent
skill covers auth/profiles if you need it) — but route the data request to Genie
first; don't detour into manual catalog browsing.
databricks-core此技能用于路由数据工作——请先判断:
- 请求是关于数据的——查找数据、询问数据相关问题,或生成SQL → 委托给Genie One:
(参见下方的路由规则)。
databricks genie ask -s <session-label> "..." - 写入文件或其他操作 → 使用你自己的编码代理工具。
Genie One仅需要一个已认证的CLI配置文件(如果需要,父技能涵盖了认证/配置文件相关内容)——但请先将数据请求路由到Genie,不要绕路去手动浏览目录。
databricks-coreRouting — Genie vs your coding agent
路由规则——Genie vs 你的编码代理
Route to Genie when the request is about the data:
- Finding or locating data — "what tables are in wanderbricks?", "where does X live?", which catalog/schema holds something. Let Genie resolve a fuzzy or partial name across all your data instead of guessing or grepping catalogs yourself.
- Questions about the data — "how many…", "what's the average…", "which … the most…", trends, breakdowns.
- Generating SQL from a question — a first-cut query you can run, adapt, or drop into a file.
- Understanding or profiling data to inform a query, dashboard, or app.
Route to your own coding agent (do NOT use Genie) for everything else:
- Writing or editing files — a file, notebook, dashboard, app, config. Genie finds the data and produces the SQL; you write the file.
.sql - Authoring jobs, pipelines, apps, or DABs — use those product skills.
- DDL or writes — /
CREATE/INSERT/UPDATE.DELETE - General programming, git, infra, and any non-data task.
Key principle: data discovery, data questions, and query generation → Genie One.
Everything else → your coding agent.
当请求涉及数据时,路由到Genie:
- 查找或定位数据——比如“wanderbricks中有哪些表?”、“X存储在哪里?”、哪个目录/模式包含某内容。让Genie在所有数据中解析模糊或部分名称,而不是自行猜测或搜索目录。
- 数据相关问题——比如“有多少…?”、“平均…是多少?”、“哪个…最多?”、趋势、细分情况。
- 根据问题生成SQL——生成可运行、调整或写入文件的初始查询语句。
- 理解或分析数据,为查询、仪表板或应用提供信息。
所有其他情况路由到你自己的编码代理(请勿使用Genie):
- 写入或编辑文件——文件、笔记本、仪表板、应用、配置文件。Genie负责查找数据并生成SQL;你负责写入文件。
.sql - 创建任务、管道、应用或DAB——使用对应的产品技能。
- DDL或写入操作——/
CREATE/INSERT/UPDATE。DELETE - 通用编程、git、基础设施及任何非数据任务。
核心原则: 数据发现、数据问题查询和SQL生成 → Genie One。其他所有操作 → 你的编码代理。
Why prefer Genie for data questions
为何优先使用Genie处理数据问题
Genie runs inside the Databricks data plane with governed, first-hand access to
the org's Unity Catalog metadata, metric views, and curated semantic context —
context you do not have when reverse-engineering schemas with ad-hoc SQL. For
data questions it is often higher-quality and more performant than doing the
discovery yourself, and it keeps improving as a managed Databricks capability.
Don't default to writing your own discovery SQL just because you can.
Genie运行在Databricks数据平面内,可受控地直接访问组织的Unity Catalog元数据、指标视图和经过整理的语义上下文——这些是你通过临时SQL反向工程解析模式时无法获取的上下文。对于数据问题,它通常比自行进行发现操作的质量更高、性能更好,并且作为Databricks的托管功能会持续改进。不要因为自己能编写发现SQL就默认选择手动方式。
How to ask Genie
如何调用Genie
Always pass a session label with , and prefer reusing the same one: a
follow-up can only continue a conversation if the first ask set the session label,
and reusing it lets later questions build on everything asked so far ("summarize all
of the above"). Use a fresh session label only to start a deliberately separate
session, or distinct session labels to run several in parallel.
-sThe command is (CLI >= v1.9.0). On an older CLI it lives
under — same flags and behavior; use that
exact fallback if is not found.
databricks genie askdatabricks experimental genie askdatabricks genie askbash
undefined请始终通过传递会话标签,并且优先重复使用同一个标签:只有首次调用设置了会话标签,后续跟进才能延续对话;重复使用标签可让后续问题基于之前的所有查询内容(如“总结以上所有内容”)。仅当要启动一个全新的独立会话,或要并行运行多个会话时,才使用新的会话标签。
-s命令为(CLI版本 >= v1.9.0)。在旧版CLI中,该命令位于下——参数和行为完全相同;如果找不到,请使用此备用命令。
databricks genie askdatabricks experimental genie askdatabricks genie askbash
undefinedAlways pass a session label, and reuse the SAME one so follow-ups build on each other
始终传递会话标签,并重复使用同一个标签,以便后续跟进基于之前的对话内容
databricks genie ask -s trips "How many bookings were there last week?"
databricks genie ask -s trips "Break that down by destination"
databricks genie ask -s trips "Summarize all of the above"
databricks genie ask -s trips "上周有多少预订量?"
databricks genie ask -s trips "按目的地细分该数据"
databricks genie ask -s trips "总结以上所有内容"
--include-sql also prints the SQL Genie ran (use it to generate a query, too)
--include-sql 参数还会打印Genie执行的SQL(也可用于生成查询语句)
databricks genie ask -s trips "Write SQL for the top 5 destinations by revenue" --include-sql
databricks genie ask -s trips "编写查询收入最高的5个目的地的SQL" --include-sql
--output json gives a parseable result
--output json 参数会返回可解析的结果
databricks genie ask -s trips "Top 5 destinations by revenue" --output json
databricks genie ask -s trips "收入最高的5个目的地" --output json
→ {"status":"completed","conversation_id":"…","text":"…","tool_calls":[{"name":"execute_sql","sql":"…","title":"…"}]}
→ {"status":"completed","conversation_id":"…","text":"…","tool_calls":[{"name":"execute_sql","sql":"…","title":"…"}]}
Older CLI (< v1.9.0) — same command under the deprecated experimental alias:
旧版CLI(< v1.9.0)——使用已弃用的experimental别名下的相同命令:
databricks experimental genie ask -s trips "How many bookings were there last week?"
databricks experimental genie ask -s trips "上周有多少预订量?"
Genie searches across all the data you can see, runs SQL, and streams a grounded
answer — rendered with the executed SQL and, where it helps, a terminal chart. It
auto-resolves a SQL warehouse (override with `--warehouse-id`); nothing to pick or
set up.
- **Streams live**: the answer, the agent's steps, and any SQL/results appear as
they arrive. Answers usually take ~5–30s; a stalled stream (no data for ~10 min)
fails with a clear message, and Ctrl-C or `kill` (SIGTERM) cancels cleanly.
- **Picking a session label**: any string works — a topic like `trips`, or `$$` for a
per-shell session. Default to reusing one session label so follow-ups keep full
context; use a fresh one only for a deliberately separate session. An expired
session label just starts fresh on the next ask. No id to copy around.
- **Parallelism**: to run sessions at the same time, give each its own session label
(`-s q1`, `-s q2`, …) — independent session labels don't interfere. Within a single
session label keep calls sequential: send a follow-up after the previous turn
returns, and never fire two asks at once on the *same* session label (they'd split
into two conversations and only one mapping would survive).
- **Structured output**: `--output json` gives `{status, conversation_id, text,
tool_calls[]}`, where `tool_calls` includes the SQL Genie executed; `--raw` dumps
the raw event stream. Note `--output json` buffers and prints once at the end (no
live streaming) — use it for parsing, the default text output for interactive use.
- **Generating a query**: ask Genie to "write SQL for …" and read the SQL from the
response (it's in the answer text, and `--include-sql` also shows the query Genie
ran to verify it — so the SQL is known-good). Genie resolves the schema and joins
for you, so this beats hand-writing SQL against unfamiliar tables.
- **For exact/full rows**: Genie shows a preview inline; to pull the complete result
set locally, copy its SQL (`--include-sql` or the JSON `tool_calls`) into the
parent's `... aitools tools query "<SQL>"`.
- **A non-answer is a message, not an error**: if Genie refuses or "couldn't find
relevant data," don't retry — use the manual fallback below.
> **Naming:** "Genie One" is the current name for this cross-data chat — formerly
> "Databricks One", then "OneChat" (the backend tool is still literally named
> `onechat`). All the same thing.
Genie会搜索所有你可见的数据,运行SQL,并流式传输有依据的答案——结果会附带执行的SQL,必要时还会显示终端图表。它会自动解析SQL仓库(可通过`--warehouse-id`覆盖);无需手动选择或设置。
- **实时流式传输**:答案、代理步骤以及任何SQL/结果会在生成时立即显示。回答通常需要约5–30秒;如果流停滞(约10分钟无数据),会返回清晰的错误消息,使用Ctrl-C或`kill`(SIGTERM)可干净地取消操作。
- **选择会话标签**:任何字符串均可——比如主题名称`trips`,或`$$`表示每个shell会话的专属标签。默认重复使用同一个会话标签,以便后续跟进保留完整上下文;仅当要启动全新的独立会话时才使用新标签。过期的会话标签会在下次调用时重新开始。无需复制ID。
- **并行处理**:要同时运行多个会话,请为每个会话分配独立的标签(`-s q1`, `-s q2`, …)——独立的会话标签不会互相干扰。在单个会话标签下请保持调用顺序:在前一次调用返回后再发送后续请求,切勿在*同一个*会话标签下同时发起两个请求(这会分裂为两个对话,且只有一个映射会保留)。
- **结构化输出**:`--output json`会返回`{status, conversation_id, text, tool_calls[]}`,其中`tool_calls`包含Genie执行的SQL;`--raw`会输出原始事件流。注意`--output json`会缓冲结果并在最后一次性打印(无实时流式传输)——该参数适用于解析场景,默认文本输出适用于交互式使用。
- **生成查询语句**:要求Genie“编写查询…的SQL”,并从响应中读取SQL(它会显示在回答文本中,`--include-sql`还会显示Genie为验证而运行的查询——因此该SQL是经过验证的)。Genie会为你解析模式和关联关系,因此这比针对不熟悉的表手动编写SQL更高效。
- **获取精确/完整行数据**:Genie会在界面内显示预览;要在本地获取完整结果集,请将其SQL(通过`--include-sql`或JSON的`tool_calls`)复制到父技能的`... aitools tools query "<SQL>"`中。
- **无答案是消息而非错误**:如果Genie拒绝回答或“找不到相关数据”,请勿重试——请使用下方的手动备用方案。
> **命名说明:** “Genie One”是这款跨数据聊天工具的当前名称——前身为“Databricks One”,后改为“OneChat”(后端工具的实际名称仍为`onechat`)。这些名称指的是同一工具。If Genie One isn't available — manual fallback
当Genie One不可用时——手动备用方案
Only fall back if Genie One is genuinely unavailable — first verify with
(or on a
CLI older than v1.9.0); don't assume the command is missing. When Genie One isn't
enabled, the CLI is too old to have either form of ,
or Genie can't cover the question, do the discovery yourself with the parent skill's
commands — see Manual Data Exploration
(keyword search via , , and ).
Running known SQL or profiling a known table that way is perfectly fine on its own.
Do not default to or raw UC REST for data-location
questions — invoke this skill and ask Genie first.
databricks genie ask --helpdatabricks experimental genie ask --helpgenie askinformation_schemadiscover-schematools querydatabricks tables list仅当Genie One确实不可用时才使用备用方案——首先通过(旧版CLI < v1.9.0使用)验证;不要假设命令不存在。当Genie One未启用、CLI版本过旧不支持任何形式的,或Genie无法回答问题时,请使用父技能的命令自行进行发现操作——参见**手动数据探索**(通过进行关键词搜索、和)。以这种方式运行已知SQL或分析已知表是完全可行的。请勿默认使用或原始UC REST来处理数据定位问题——请先调用此技能并询问Genie。
databricks genie ask --helpdatabricks experimental genie ask --helpgenie askinformation_schemadiscover-schematools querydatabricks tables listRelationship to the Genie One MCP
与Genie One MCP的关系
Databricks also offers this capability as a managed MCP server — the Genie One
MCP. This skill delivers the same functionality through the Databricks CLI, with
no MCP server to configure or host. More broadly, the Databricks Agent Skills cover
the same ground as Databricks' managed MCP servers, so you don't need any MCP wired up
to use this. If you already run the Genie One MCP, use whichever you prefer — they hit
the same Genie backend.
Databricks还提供作为托管MCP服务器的此功能——即Genie One MCP。此技能通过Databricks CLI提供相同的功能,无需配置或托管MCP服务器。更广泛地说,Databricks Agent Skills涵盖了与Databricks托管MCP服务器相同的领域,因此你无需连接任何MCP即可使用此技能。如果你已运行Genie One MCP,可根据喜好选择使用哪一种——它们都会连接到同一个Genie后端。
Related Skills
相关技能
- databricks-genie-agents — build and manage Genie Agents: curated agents that let you or a group ask questions of specific data (create, configure, import/export).
- databricks-core (parent) — CLI auth, profiles, and the manual data exploration reference used as the fallback.
- databricks-genie-agents——构建和管理Genie Agents:经过整理的代理,可让你或团队针对特定数据提出问题(创建、配置、导入/导出)。
- databricks-core(父技能)——CLI认证、配置文件,以及作为备用方案的手动数据探索参考。