Skip to content

feat(schema-compiler)!: Remove deprecated running_total measure type#11044

Open
ovr wants to merge 2 commits into
feat/release-v1.7.0from
feat/remove-running-total
Open

feat(schema-compiler)!: Remove deprecated running_total measure type#11044
ovr wants to merge 2 commits into
feat/release-v1.7.0from
feat/remove-running-total

Conversation

@ovr

@ovr ovr commented Jun 9, 2026

Copy link
Copy Markdown
Member

BREAKING CHANGE: The running_total measure type has been removed. Data models that use type: running_total will now fail validation. Replace them with a rolling_window measure using an unbounded trailing window, e.g.

The running_total measure type was deprecated in v0.33.39 in favor of a
rolling_window with an unbounded trailing window. Remove it fully from both
query engines so it is now rejected at validation.

- CubeValidator: drop runningTotal from the measure-type enums (rejected)
- BaseMeasure/BaseQuery/BigqueryQuery: remove the runningTotal join condition
  and aggregation handling; isCumulative now keys off rollingWindow
- cubesqlplanner: remove AggregationType::RunningTotal, RollingWindowType::
  RunningTotal, MultiStageRollingWindowType::RunningTotal, the RollingTotal
  join condition, and is_running_total()
- cubesql: drop the runningTotal -> Double column-type mapping
- Remove deprecated-type tests/fixtures/snapshots (measures named
  runningTotal that use count/sum + rolling_window are the recommended
  replacement and are kept)
- DEPRECATION.md: mark Removed in v1.7.0

BREAKING CHANGE: The running_total measure type has been removed. Data models
that use `type: running_total` will now fail validation. Replace them with a
rolling_window measure using an unbounded trailing window, e.g.

  type: sum
  rolling_window:
    trailing: unbounded
@ovr ovr requested review from a team as code owners June 9, 2026 16:33
@github-actions github-actions Bot added rust Pull requests that update Rust code javascript Pull requests that update Javascript code labels Jun 9, 2026
@claude

claude Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Claude finished @ovr's task in 2m 8s —— View job


Code Review

Verdict: LGTM — clean, surgical removal. 0 high, 0 medium, 2 low.

Details (expand)
  • Gather context
  • Review schema-compiler changes
  • Review Rust planner changes
  • Check for stale references to running_total
  • Post review

Summary

The PR is a clean, well-scoped removal of the long-deprecated running_total measure type:

  • Validator (CubeValidator.ts) drops the literal from all three measure-type unions, so any data model still using type: running_total will fail at compile time as advertised.
  • JS adapter (BaseMeasure.ts, BaseQuery.js, BigqueryQuery.ts) removes the runningTotal branches from isCumulative, rollingWindowDefinition, dateJoinCondition, and the SQL evaluator, plus the now-unreachable runningTotalDateJoinCondition helpers.
  • Rust planner removes the AggregationType::RunningTotal variant, the RollingWindowType::RunningTotal / MultiStageRollingWindowType::RunningTotal flavors, the RollingTotalJoinCondition physical node, the is_running_total() predicate, and the new_running_total constructor.
  • Tests + snapshots for the removed behavior are deleted; DEPRECATION.md is updated to "Removed in v1.7.0".

Cross-checked for stragglers:

  • git grep -i 'running_total\|runningTotal\|RunningTotal' over rust/, docs-mintlify/, docs/, and packages/cubejs-schema-compiler/src/ returns nothing besides the intentional deprecation notice.
  • Remaining runningTotal identifiers in packages/cubejs-testing-drivers/fixtures/*, packages/cubejs-testing/birdbox-fixtures/.../Customers.js, and cube-views.test.ts are just measure names — they are already defined as type: count + rollingWindow: { trailing: 'unbounded' }, i.e. the recommended replacement pattern. No action needed.
  • isCumulative / is_cumulative callers (PreAggregations.ts, CubeStoreQuery.ts, CubeToMetaTransformer.ts, measure_matcher.rs, has_multi_stage_members.rs, multi_stage_query_planner.rs) all continue to work correctly with the narrower rollingWindow-only definition.

Minor observations (non-blocking)

  1. Migration error UX. Users with type: running_total in their schema will now hit a generic Joi "must be one of [...]" error. Given this is a hard removal of a long-deprecated feature, a custom validator that detects the legacy value and points at the rolling_window + trailing: unbounded replacement (mirroring DEPRECATION.md) would make migration smoother. Optional.

  2. Stray blank line. rust/cube/cubesqlplanner/cubesqlplanner/src/planner/planners/multi_stage/member.rs line 88 leaves a blank line immediately before the closing } of the impl block where new_running_total was deleted. Trivial cleanup.

Other checks

  • Security / input handling: N/A — this PR strictly narrows the accepted value set; no new input is parsed.
  • Performance: Unchanged; fewer match arms / branches.
  • Public API: This is a breaking change, correctly flagged with feat!: and a BREAKING CHANGE: footer. Targets v1.7.0, which matches DEPRECATION.md. The PR is correctly based on feat/release-v1.7.0 rather than main — good.
  • Tests: All removed tests are specific to running_total semantics; nothing in retained tests still exercises the removed code paths (verified by greps above).
• [Branch](https://github.com/cube-js/cube/tree/feat/remove-running-total)

@codecov

codecov Bot commented Jun 9, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.09%. Comparing base (11fb609) to head (abc4910).
⚠️ Report is 7 commits behind head on feat/release-v1.7.0.

Additional details and impacted files
@@                   Coverage Diff                   @@
##           feat/release-v1.7.0   #11044      +/-   ##
=======================================================
- Coverage                83.33%   79.09%   -4.24%     
=======================================================
  Files                      255      470     +215     
  Lines                    77261    95772   +18511     
  Branches                     0     3502    +3502     
=======================================================
+ Hits                     64382    75747   +11365     
- Misses                   12879    19510    +6631     
- Partials                     0      515     +515     
Flag Coverage Δ
cube-backend 58.67% <100.00%> (?)
cubesql 83.54% <ø> (+0.21%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@claude

claude Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Claude finished @ovr's task in 44s —— View job


Code Review (updated after chore: fmt)

Verdict: LGTM — clean, surgical removal. 0 high, 0 medium, 1 low.

Details (expand)
  • Gather context
  • Re-check delta from chore: fmt commit (abc4910)
  • Review schema-compiler changes
  • Review Rust planner changes
  • Check for stale references to running_total
  • Post review

Delta since previous review

abc4910 chore: fmt removes the stray blank line in rust/cube/cubesqlplanner/cubesqlplanner/src/planner/planners/multi_stage/member.rs that I flagged previously — addressed. No other code changes in this push.

Summary

Clean, well-scoped removal of the long-deprecated running_total measure type:

  • Validator (CubeValidator.ts) drops the literal from all three measure-type unions, so any data model still using type: running_total will fail at compile time as advertised.
  • JS adapter (BaseMeasure.ts, BaseQuery.js, BigqueryQuery.ts) removes the runningTotal branches from isCumulative, rollingWindowDefinition, dateJoinCondition, and the SQL evaluator, plus the now-unreachable runningTotalDateJoinCondition helpers.
  • Rust planner removes AggregationType::RunningTotal, the RollingWindowType::RunningTotal / MultiStageRollingWindowType::RunningTotal flavors, the RollingTotalJoinCondition physical node, the is_running_total() predicate, and the new_running_total constructor.
  • Tests + snapshots for the removed behavior are deleted; DEPRECATION.md is updated to "Removed in v1.7.0".

Cross-checked for stragglers:

  • git grep -i 'running_total\|runningTotal\|RunningTotal' over rust/, docs-mintlify/, docs/, and packages/cubejs-schema-compiler/src/ returns nothing besides the intentional deprecation notice.
  • Remaining runningTotal identifiers in packages/cubejs-testing-drivers/fixtures/*, packages/cubejs-testing/birdbox-fixtures/.../Customers.js, and cube-views.test.ts are just measure names — already defined as type: count + rollingWindow: { trailing: 'unbounded' }, i.e. the recommended replacement pattern.
  • isCumulative / is_cumulative callers (PreAggregations.ts, CubeStoreQuery.ts, CubeToMetaTransformer.ts, measure_matcher.rs, has_multi_stage_members.rs, multi_stage_query_planner.rs) all continue to work correctly with the narrower rollingWindow-only definition.

Minor observations (non-blocking)

  1. Migration error UX. Users with type: running_total in their schema will now hit a generic Joi "must be one of [...]" error. Given this is a hard removal of a long-deprecated feature, a custom validator that detects the legacy value and points at the rolling_window + trailing: unbounded replacement (mirroring DEPRECATION.md) would make migration smoother. Optional. Fix this →

Other checks

  • Security / input handling: N/A — strictly narrows the accepted value set.
  • Performance: Unchanged; fewer match arms / branches.
  • Public API: Breaking change, correctly flagged with feat!: and a BREAKING CHANGE: footer. Targets v1.7.0, which matches DEPRECATION.md. Correctly based on feat/release-v1.7.0.
  • Tests: All removed tests are specific to running_total semantics; nothing in retained tests still exercises the removed code paths.
• [Branch](https://github.com/cube-js/cube/tree/feat/remove-running-total)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

javascript Pull requests that update Javascript code rust Pull requests that update Rust code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants