thomazrossito/data-agents/databricks-metric-views
Claude Code and agent skill by thomazrossito/data-agents
- community
Checking that the SKILL.md file is still in the repository.
Unity Catalog metric views: define, create, query, and manage governed business metrics in YAML. Use when building standardized KPIs, revenue metrics, order analytics, or any reusable business metrics that need consistent definitions across teams and tools.
Install
npx vskill@latest install thomazrossito/data-agents/databricks-metric-viewsSKILL.md
The same SKILL.md was published earlier as thomazrossito/data-agents/databricks-metric-views.
Unity Catalog Metric Views
Define reusable, governed business metrics in YAML that separate measure definitions from dimension groupings for flexible querying.
When to Use
Use this skill when:
- Defining standardized business metrics (revenue, order counts, conversion rates)
- Building KPI layers shared across dashboards, Genie, and SQL queries
- Creating metrics with complex aggregations (ratios, distinct counts, filtered measures)
- Defining window measures (moving averages, running totals, period-over-period, YTD)
- Modeling star or snowflake schemas with joins in metric definitions
- Enabling materialization for pre-computed metric aggregations
Prerequisites
- Databricks Runtime 17.2+ (for YAML version 1.1)
- SQL warehouse with
CAN USEpermissions SELECTon source tables,CREATE TABLE+USE SCHEMAin the target schema
Quick Start
Inspect Source Table Schema
Before creating a metric view, call get_table_stats_and_schema to understand available columns for dimensions and measures:
Create a Metric View
Query a Metric View
All measures must use the MEASURE() function. SELECT * is NOT supported.
Reference Files
| Topic | File | Description | |
|---|---|---|---|
| YAML Syntax | yaml-reference.md | Complete YAML spec: dimensions, measures, joins, materialization | |
| Patterns & Examples | patterns.md | Common patterns: star schema, snowflake, filtered measures, window measures, ratios |
MCP Tools
Use the manage_metric_views tool for all metric view operations:
| Action | Description | |
|---|---|---|
create | Create a metric view with dimensions and measures | |
alter | Update a metric view's YAML definition | |
describe | Get the full definition and metadata | |
query | Query measures grouped by dimensions | |
drop | Drop a metric view | |
grant | Grant SELECT privileges to users/groups |
Create via MCP
Query via MCP
Describe via MCP
Grant Access
YAML Spec Quick Reference
Key Concepts
Dimensions vs Measures
| Dimensions | Measures | ||
|---|---|---|---|
| Purpose | Categorize and group data | Aggregate numeric values | |
| Examples | Region, Date, Status | SUM(revenue), COUNT(orders) | |
| In queries | Used in SELECT and GROUP BY | Wrapped in MEASURE() | |
| SQL expressions | Any SQL expression | Must use aggregate functions |
Why Metric Views vs Standard Views?
| Feature | Standard Views | Metric Views | |
|---|---|---|---|
| Aggregation locked at creation | Yes | No - flexible at query time | |
| Safe re-aggregation of ratios | No | Yes | |
| Star/snowflake schema joins | Manual | Declarative in YAML | |
| Materialization | Separate MV needed | Built-in | |
| AI/BI Genie integration | Limited | Native |
Common Issues
| Issue | Solution | |
|---|---|---|
| SELECT * not supported | Must explicitly list dimensions and use MEASURE() for measures | |
| "Cannot resolve column" | Dimension/measure names with spaces need backtick quoting | |
| JOIN at query time fails | Joins must be in the YAML definition, not in the SELECT query | |
| MEASURE() required | All measure references must be wrapped: MEASURE(\name\) | |
| DBR version error | Requires Runtime 17.2+ for YAML v1.1, or 16.4+ for v0.1 | |
| Materialization not working | Requires serverless compute enabled; currently experimental |
Integrations
Metric views work natively with:
- AI/BI Dashboards - Use as datasets for visualizations
- AI/BI Genie - Natural language querying of metrics
- Alerts - Set threshold-based alerts on measures
- SQL Editor - Direct SQL querying with MEASURE()
- Catalog Explorer UI - Visual creation and browsing
Resources
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/databricks/databricks-metric-views/SKILL.md
Popularity
- Repository stars
- 30
- Repository forks
- 20
- 7-day trend score
- 17
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/thomazrossito/data-agents/databricks-metric-views)