feat: Cube.js schema and view definitions
Open-source Excel-native EPM and consolidation for SAP & Dynamics
Brought to you by:
konsolid-at
Originally created by: grynn-in
cube/cube.js picks up new schema/view YAML files🤖 Generated with Claude Code
Originally posted by: grynn-in
Code Review: PR [#33] — Cube.js schemas & views
Verdict: REQUEST CHANGES — 3 issues (1 critical, 2 medium)
1. CRITICAL: Views won't load
cube.jssetsschemaPath: '/cube/schema'but views are in/cube/views/. Cube.js only scans the schemaPath directory. Views will be silently ignored.Fix options:
cube/schema/(simplest)cube.jsto setschemaPathto/cubeand restructure2. MEDIUM:
meta.sql_filterhas no effectViews
v_balance_sheetandv_pnl_reportusemeta.sql_filter: trial_balance.is_balance_sheet = true. Themetablock in Cube.js views is arbitrary metadata — it does NOT apply a SQL filter. These views will return ALL trial_balance rows unfiltered.Fix: Create cube-level segments:
Or create filtered cubes (
trial_balance_bs,trial_balance_pnl) with SQL subqueries. Views alone can't apply WHERE filters.3. MEDIUM: Hardcoded dynamic dimensions
dim_cost_center,dim_department,dim_business_unitare hardcoded in cube schemas, but the dbt model generates them dynamically viadim_select(). When users add/remove dimensions through the schema lifecycle (konsol PR [#6]), cube schemas go stale.Acceptable for now (manual sync) but should be documented.
What's correct
scenario_trial_balanceCASE WHEN measures correctly pivot theamountcolumn — good patternallocation_resultscolumns match the macro outputconsolidated_trial_balancedimensions and measures are accuratesql_tablereferences point to correctepm_gold.*tablesRelated
Tickets:
#33Tickets:
#6Ticket changed by: grynn-in