Databricks Genie Spaces for SQL Analysts: Natural Language Querying Without Leaving Your Data Platform
Mehul K. Bhuva (Data & AI Platform Engineer at Corteva Agriscience) writes a practitioner's field manual for Databricks Genie Spaces, the chat interface inside Databricks where business users ask plain-English questions and Genie writes and runs the SQL. His framing: Genie doesn't remove the SQL analyst, it moves them upstream — analysts build and configure the space, business users consume it, and the answer is "only ever as good as the context you feed it."
The core of the piece is the claim that a Genie Space is four layers stacked, all of which must be right: Data (one clean, pre-joined Unity Catalog view instead of a pile of raw tables, with test-row exclusion baked into the view's WHERE clause so every inherited query is safe), Instructions (plain-English business rules Genie reads like a system prompt — fiscal-year definition, active-customer definition, "top performers" defaults, the Midwest state list, a double test-data filter, and an ask-for-clarification rule for ambiguous time periods), SQL Expressions (named, certified metric definitions — "Active Customers," "YTD Revenue," "Gross Margin %" — that Genie matches by name and uses verbatim instead of inventing a formula), and Example Queries (registered question+SQL pairs whose shape transfers to similar new questions; no retraining, closer to "handing a new hire a worked example").
Column COMMENT metadata is called the single highest-leverage step: enumerating real values ("Midwest is one of five defined regions") turns fuzzy terms into vocabulary Genie translates against. The production lessons: keep scope tight (one view per space; build a second space rather than adding tables), prefer formulas over prose ("text instructions are guidance, but a SQL Expression is truth"), always read the generated SQL and register corrections, map synonyms ("client" vs customer_name), and treat examples as regression tests re-run after every change. A table mapping stakeholder questions to the layer that delivers each answer doubles as a debugging map. The closing reframe: the analyst becomes the curator of the certified knowledge layer — metric definitions, business rules, shared vocabulary — "a bigger job than writing JOINs, not a smaller one."