Skip to content

feat(gold): Kimball star schema — 10 dimensions + 8 fact tables#116

Merged
EduardPetraeus merged 1 commit intomainfrom
feature/gold-kimball-model
Mar 8, 2026
Merged

feat(gold): Kimball star schema — 10 dimensions + 8 fact tables#116
EduardPetraeus merged 1 commit intomainfrom
feature/gold-kimball-model

Conversation

@EduardPetraeus
Copy link
Owner

Summary

  • Adds complete Kimball dimensional model in Gold layer for cross-domain health analytics
  • 10 dimension tables: dim_date, dim_time_of_day, dim_health_zone, dim_source, dim_body_system, dim_metric, dim_workout_type, dim_meal_type, dim_lab_marker, dim_supplement
  • 8 fact tables/views: fct_daily_health_score (composite 35/35/30), fct_daily_heart_rate_summary, fct_sleep_session, fct_workout, fct_daily_nutrition, fct_body_measurement, fct_lab_result, fct_daily_vitals_summary
  • DuckDB-native SQL in transformation_logic/gold/sql/ (separate from Databricks gold views)
  • Exclusive upper bound convention for zone joins (score >= min AND score < max)

Verification

  • 18/18 SQL files execute against DuckDB dev database
  • FK integrity: 0 orphans across all fact→dim joins
  • Zone classification working: excellent(6), good(11), fair(14) days
  • Spot-checked dim_date (weekends, seasons correct)
  • Example queries from plan all return correct results
  • No secrets or PII in any file

Test plan

  • All SQL files verified against health_dw_dev.db
  • Tables with real data: dim_date(4018), dim_time_of_day(1440), dim_health_zone(42), fct_daily_health_score(31), fct_sleep_session(31), fct_body_measurement(14), fct_daily_heart_rate_summary(93)
  • Tables awaiting silver data: workout, meal, lab, supplement, vitals (SQL verified with stubs)

Generated with Claude Code

Implements a complete dimensional model in the Gold layer for cross-domain
health analytics. 10 dimension tables (date, time_of_day, health_zone,
source, body_system, metric, workout_type, meal_type, lab_marker,
supplement) and 8 fact tables/views (daily_health_score, heart_rate_summary,
sleep_session, workout, daily_nutrition, body_measurement, lab_result,
daily_vitals_summary). DuckDB-native SQL with exclusive upper bound
convention for zone joins. Verified against dev database with real data.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@EduardPetraeus EduardPetraeus merged commit 09c92c1 into main Mar 8, 2026
7 of 9 checks passed
@EduardPetraeus EduardPetraeus deleted the feature/gold-kimball-model branch March 8, 2026 04:39
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