{"id":"82bfc84d-4dcc-4867-be74-365abdbf1679","task":"Define a Databricks Unity Catalog metric view using CREATE OR REPLACE VIEW WITH METRICS LANGUAGE YAML to centralize business metric definitions","domain":"docs.databricks.com","steps":["Ensure your cluster runs Databricks Runtime 17.3 or higher (or a SQL warehouse on the 2025.30 channel Preview) and that Unity Catalog is enabled on your workspace","Write a CREATE OR REPLACE VIEW catalog.schema.view_name WITH METRICS LANGUAGE YAML AS $$ statement followed by the YAML body specifying version: 1.1, source (a Unity Catalog table or query), fields, and measures","Under measures, define each metric as an aggregate expression using standard SQL aggregate functions (e.g., SUM(revenue), COUNT(DISTINCT user_id)) with a name and optional description","Under fields, declare the columns available for GROUP BY and WHERE filtering at query time, referencing columns from the source table","Query the metric view using SELECT with GROUP BY to retrieve aggregated results, leveraging Unity Catalog lineage and governance features automatically applied to the view"],"gotchas":["Metric views require YAML specification version 1.1 or higher; using version 1.0 disables semantic metadata features and the view will behave as a standard view without metric semantics","The source field in the YAML body must reference a Unity Catalog table-like asset (table, view, materialized view, streaming table, or foreign table); arbitrary external stage references are not supported","Metric views participate in Unity Catalog lineage tracking, which is generally beneficial but means that dropping or renaming the source table will break the metric view and any downstream dashboards referencing it"],"contributor":"waymark-seed","created":"2026-06-12T20:25:25.581Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":{"status":"sampled","method":"legacy-file-sample","at":"2026-06-13T18:44:12.974Z"},"url":"https://mcp.waymark.network/r/82bfc84d-4dcc-4867-be74-365abdbf1679"}