apache/druid · error · IllegalArgumentException
Right hand side too big to fit in the result value
Error message
Right hand side too big to fit in the result value
What it means
Thrown during accumulateSum when the addend's underlying array is larger than the accumulator's result array; per the method contract higher-order bits would be dropped, and this path rejects the accumulation when the addend cannot fit.
Solutions
- Configure the aggregator with a larger size (number of ints) so accumulated values fit.
- Pre-scale or round inputs so their compressed representation fits the result size.
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at extensions-contrib/compressed-bigdecimal/src/main/java/org/apache/druid/compressedbigdecimal/CompressedBigDecimal.java:68 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of apache/druid@9b90983fd2 (2026-09-07).
Data as JSON: /api/errors/cbb7ac879d991412.
Report an issue: GitHub.
Appendix: source
Thrown at extensions-contrib/compressed-bigdecimal/src/main/java/org/apache/druid/compressedbigdecimal/CompressedBigDecimal.java:68
/**
* Accumulate (add) the passed in value into the current total. This
* modifies the value of the current object. Accumulation requires that
* the two numbers have the same scale, but does not require that they are
* of the same size. If the value being accumulated has a larger underlying array
* than this value (the result), then the higher order bits are dropped, similar to
* what happens when adding a long to an int and storing the result in an int.
*
* @param rhs The object to accumulate
* @return a reference to <b>this</b>
*/
public CompressedBigDecimal accumulateSum(CompressedBigDecimal rhs)
{
checkScaleCompatibility(rhs);
if (rhs.getArraySize() > getArraySize()) {
throw new IllegalArgumentException("Right hand side too big to fit in the result value");
}
internalAdd(getArraySize(), this, CompressedBigDecimal::getArrayEntry, CompressedBigDecimal::setArrayEntry,
rhs.getArraySize(), rhs, CompressedBigDecimal::getArrayEntry
);
return this;
}
public CompressedBigDecimal accumulateMax(CompressedBigDecimal rhs)
{
checkScaleCompatibility(rhs);
if (compareTo(rhs) < 0) {
setValue(rhs);
}
return this;
}
View on GitHub (pinned to 9b90983fd2)