{"record":{"id":"cbb7ac879d991412","repo":"apache/druid","slug":"right-hand-side-too-big-to-fit-in-the-result-value-cbb7ac","errorCode":null,"errorMessage":"Right hand side too big to fit in the result value","messagePattern":"Right hand side too big to fit in the result value","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"extensions-contrib/compressed-bigdecimal/src/main/java/org/apache/druid/compressedbigdecimal/CompressedBigDecimal.java","lineNumber":68,"sourceCode":"\n\n  /**\n   * Accumulate (add) the passed in value into the current total. This\n   * modifies the value of the current object. Accumulation requires that\n   * the two numbers have the same scale, but does not require that they are\n   * of the same size. If the value being accumulated has a larger underlying array\n   * than this value (the result), then the higher order bits are dropped, similar to\n   * what happens when adding a long to an int and storing the result in an int.\n   *\n   * @param rhs The object to accumulate\n   * @return a reference to <b>this</b>\n   */\n  public CompressedBigDecimal accumulateSum(CompressedBigDecimal rhs)\n  {\n    checkScaleCompatibility(rhs);\n\n    if (rhs.getArraySize() > getArraySize()) {\n      throw new IllegalArgumentException(\"Right hand side too big to fit in the result value\");\n    }\n    internalAdd(getArraySize(), this, CompressedBigDecimal::getArrayEntry, CompressedBigDecimal::setArrayEntry,\n                rhs.getArraySize(), rhs, CompressedBigDecimal::getArrayEntry\n    );\n    return this;\n  }\n\n  public CompressedBigDecimal accumulateMax(CompressedBigDecimal rhs)\n  {\n    checkScaleCompatibility(rhs);\n\n    if (compareTo(rhs) < 0) {\n      setValue(rhs);\n    }\n\n    return this;\n  }\n","sourceCodeStart":50,"sourceCodeEnd":86,"githubUrl":"https://github.com/apache/druid/blob/9b90983fd291f26935af934383ce360473179e4d/extensions-contrib/compressed-bigdecimal/src/main/java/org/apache/druid/compressedbigdecimal/CompressedBigDecimal.java#L50-L86","documentation":"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.","triggerScenarios":"Thrown at extensions-contrib/compressed-bigdecimal/src/main/java/org/apache/druid/compressedbigdecimal/CompressedBigDecimal.java:68 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","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."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"9b90983fd291f26935af934383ce360473179e4d","analyzedAt":"2026-09-07T13:32:30.957Z","contentChangedAt":"2026-09-07T13:32:30.957Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}