Skip to content

docs: add SCD/dimensional modeling reference for databricks-dbsql - #207

Open
dipayanthedata wants to merge 1 commit into
databricks:mainfrom
dipayanthedata:feat_dimensional_modeling_scd_reference
Open

docs: add SCD/dimensional modeling reference for databricks-dbsql#207
dipayanthedata wants to merge 1 commit into
databricks:mainfrom
dipayanthedata:feat_dimensional_modeling_scd_reference

Conversation

@dipayanthedata

Copy link
Copy Markdown

What

Adds skills/databricks-dbsql/references/dimensional-modeling.md — implementation
patterns for SCD Type 1/2/6, surrogate keys (IDENTITY vs hash), Liquid Clustering

  • Predictive Optimization for dimension tables, and Deep Clone for environment
    promotion. Wires the new reference into the parent SKILL.md.

Why

The existing skill covers architecture (best-practices.md) and streaming CDC
(databricks-pipelines) but had no batch SQL implementation guide for SCD patterns
— Type 2 was previously a one-line comment, Type 6, hash surrogate keys, and Deep
Clone promotion were absent entirely.

Verification

All Databricks-specific syntax and behavior claims were checked against current
docs.databricks.com pages (predictive optimization, Delta/Iceberg clone, identity
columns, Lakeflow pipeline limitations) as of July 2026 — sources noted inline
where non-obvious. The SCD Type 2 two-pass MERGE was hand-traced against a 3-row
worked example (initial load, one changed row, one net-new row) since no live
warehouse was available in this environment to execute it directly; a maintainer
should run it once against real data before merge.

python3 scripts/skills.py generate and validate both pass clean.

Notes for reviewers

  • Per CONTRIBUTING.md, understand this repo mirrors an internal source of truth —
    happy to have this migrated/adapted however fits your internal process.
  • Scope: the SCD Type 2 pattern here handles changed and net-new rows from a full
    extract; it does not handle delete detection (documented as a caveat in the file).

…rrogate key patterns

Adds skills/databricks-dbsql/references/dimensional-modeling.md covering:
- SCD type selection decision table
- Surrogate key strategies (IDENTITY column vs xxhash64 hash key)
- Complete two-pass MERGE for SCD Type 2 (expire + insert, with correct LEFT JOIN guard)
- SCD Type 6 hybrid pattern (Type 2 rows + current_* column refresh)
- Liquid Clustering key guidance for dim/fact tables + Predictive Optimization enable syntax
- DEEP CLONE for environment promotion (dev/staging/prod)
- Common issues table

Wires new file into databricks-dbsql SKILL.md Quick Reference and Reference Files tables.
Regenerates manifest.json and all four plugin bundles via scripts/skills.py generate.

Fills the gap identified in #-- (no assembled dimensional modeling implementation guide;
best-practices.md covers architecture but leaves SCD implementations incomplete;
SCD Type 6, hash surrogate keys, and Deep Clone were absent from the skill entirely).

Signed-off-by: Dipayan Das <dipayandas.data@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant