Knowledge base: metric views#156
Open
lennartkats-db wants to merge 7 commits into
Open
Conversation
Two parallel knowledge_base demos for creating a Unity Catalog Metric View from a bundle: - knowledge_base/metric_view/ — minimal sql_task-in-a-job pattern that runs CREATE OR REPLACE VIEW ... WITH METRICS LANGUAGE YAML against a SQL warehouse. - knowledge_base/metric_view-dbt/ — dbt-databricks 1.12.0+ variant using the new `metric_view` materialization (dbt-databricks PR #1285). Both define bookings_kpis over samples.wanderbricks.bookings and were verified end-to-end on a real workspace (17,948 bookings / $9.9M revenue). Co-authored-by: Isaac
…consistency Co-authored-by: Isaac
Co-authored-by: Isaac
From a fresh-user walkthrough of both metric_view examples: - Add `CREATE SCHEMA IF NOT EXISTS` to the SQL variant so the example works even when the target schema doesn't pre-exist (the dbt variant already handles this via the adapter). - Mention the `host: https://company.databricks.com` placeholder in both READMEs' Getting started — previously a silent first-time-user trap. - Note that the default `catalog: main` is often not writable; flag this in the Getting started for both variants. - Align the YAML body with the official docs: - bump version 0.1 → 1.0 - drop the redundant `status` dimension (the filter already pins it) - drop outer quotes on `filter:` - add `comment:` at the metric view level and on each measure - Soften the DBR / wrapper-internals claims in both READMEs to match what the docs actually guarantee. - Drop the misleading "serverless" qualifier on the warehouse placeholder. Co-authored-by: Isaac
- Both jobs gain a `trigger: periodic: {interval: 1, unit: DAYS}` so the
view definition is re-applied daily in production. mode: development
auto-pauses the trigger; only fires after `bundle deploy --target prod`.
- Restructure both READMEs to match the udtf-operator shape:
Concrete Example (Definition + SQL Usage), Getting Started
(Prerequisites / Setup / Deployment for dev and prod), Advanced Topics,
Learn More.
- Link Advanced Topics' scheduling note to the deployment-modes docs.
Co-authored-by: Isaac
pietern
approved these changes
May 28, 2026
Co-authored-by: Julia Crawford (Databricks) <julia.crawford@databricks.com>
Apply Julia's PR #156 inline suggestions (and parallel changes for the metric_view_dbt variant) plus a few related cleanups surfaced by a clean-context review: - Drop the dbt-variant cross-link from metric_view/README.md (don't advertise dbt from the canonical example). Keep the inverse link. - Drop the `workspace:` block (and prod root_path / permissions placeholders) from both databricks.yml — let the user's profile pin the host. - Tighten databricks.yml comments: drop the dbt-PR/version reference, drop "Bundles do not yet support" staleness risk. - Periods on variable descriptions. - README structure: drop redundant subheaders, `## Get started` (not "Getting Started With This Project"), `## Learn more` (sentence case), `### Notes` instead of `## Advanced Topics`. - Snippet matches query (no undefined fields), placeholder consistency (<catalog>.<your_schema>, no main.<your_schema> mix-up). - Drop `aws/en/` from doc URLs (also in dbt model file). - "Once registered" instead of "Once deployed" — accurate, matches Julia's suggestion. - Unify prod schema across variants (dbt prod schema was `default`, SQL was `prod` — now both `prod`). - Drop redundant "view integrates seamlessly with..." marketing line. - Individual code blocks per command for easy copy-paste. Co-authored-by: Isaac
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds metric view examples to knowledge base: one based on a SQL job, one based on databricks-dbt.