Skip to content

docs(cayenne): maintained SUM/AVG now support Decimal128 (vNext)#1962

Merged
lukekim merged 1 commit into
trunkfrom
docs-cayenne-maintained-decimal128
Jul 23, 2026
Merged

docs(cayenne): maintained SUM/AVG now support Decimal128 (vNext)#1962
lukekim merged 1 commit into
trunkfrom
docs-cayenne-maintained-decimal128

Conversation

@claudespice

Copy link
Copy Markdown
Collaborator

Summary

spiceai/spiceai#11979 extends Cayenne's incrementally-maintained aggregate views (maintained_aggregates) so SUM and AVG accept Decimal128 input columns — the CDC money-column case (e.g. Postgres NUMERIC(6,2)). Previously a Decimal128 column was rejected at dataset registration, taking the dataset unhealthy. The maintained-aggregate supported-type list on the Cayenne page listed only integer and float families for sum/avg and said "avg always returns Float64", both now inaccurate.

Updated the sum/avg supported-input-types bullet to add Decimal128 and document DataFusion's exact decimal return types:

  • SUM(Decimal128(p, s))Decimal128(min(38, p + 10), s)
  • AVG(Decimal128(p, s))Decimal128(min(38, p + 4), min(38, s + 4)), non-negative scale only
  • Decimal256 is not supported

Verified against source (origin/trunk)

  • crates/cayenne/src/maintained_aggregate.rsAggregateOutputType::Decimal128, SumDecimal128/AvgDecimal128 accumulators, and the documented output precision/scale formulas; Decimal256 and negative-scale AVG safe-decline.

Source PRs

Test plan

  • cd website && npm run build passes (exit 0)
  • vNext-only addition (feature is post-v2.1.1); the "avg always returns Float64" text is correct for v2.1.x, so no versioned-docs change
  • Files updated: 1

spiceai/spiceai#11979 extends Cayenne maintained-aggregate IVM views so
SUM and AVG accept Decimal128 columns (the CDC money-column case), with
exact i128 backing-value accumulators. Document the supported types and
DataFusion's decimal return types:
  SUM(p,s) -> Decimal128(min(38,p+10), s)
  AVG(p,s) -> Decimal128(min(38,p+4), min(38,s+4))  (non-negative scale)
Decimal256 is not supported.

vNext-only (feature is post-v2.1.1); no versioned-docs propagation.
@github-actions

github-actions Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

🔍 Pull with Spice Failed

Passing checks:

  • ✅ Title meets minimum length requirement (10 characters)
  • ✅ Has at least one of the required labels: area/blog, area/docs, area/cookbook, dependencies
  • ✅ No banned labels detected

Failed checks:

  • ❌ At least one assignee is required for this pull request.

Please address these issues and update your pull request.

@github-actions

Copy link
Copy Markdown
Contributor

🚀 deployed to https://f2f90ec8.spiceai-org-website.pages.dev

@lukekim
lukekim merged commit 2e5ab56 into trunk Jul 23, 2026
6 of 10 checks passed
@lukekim
lukekim deleted the docs-cayenne-maintained-decimal128 branch July 23, 2026 14:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants