docs(cayenne): maintained SUM/AVG now support Decimal128 (vNext)#1962
Merged
Conversation
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.
Contributor
🔍 Pull with Spice FailedPassing checks:
Failed checks:
Please address these issues and update your pull request. |
Contributor
|
🚀 deployed to https://f2f90ec8.spiceai-org-website.pages.dev |
lukekim
approved these changes
Jul 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
spiceai/spiceai#11979 extends Cayenne's incrementally-maintained aggregate views (
maintained_aggregates) soSUMandAVGacceptDecimal128input columns — the CDC money-column case (e.g. PostgresNUMERIC(6,2)). Previously aDecimal128column 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 forsum/avgand said "avgalways returnsFloat64", both now inaccurate.Updated the
sum/avgsupported-input-types bullet to addDecimal128and 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 onlyDecimal256is not supportedVerified against source (
origin/trunk)crates/cayenne/src/maintained_aggregate.rs—AggregateOutputType::Decimal128,SumDecimal128/AvgDecimal128accumulators, and the documented output precision/scale formulas;Decimal256and negative-scaleAVGsafe-decline.Source PRs
Test plan
cd website && npm run buildpasses (exit 0)