{"record":{"id":"e22bb8a350f7a049","repo":"apache/druid","slug":"s-is-too-large","errorCode":null,"errorMessage":"%s is too large","messagePattern":"(.+?) is too large","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"processing/src/main/java/org/apache/druid/indexer/partitions/DimensionRangePartitionsSpec.java","lineNumber":95,"sourceCode":"    Preconditions.checkArgument(\n        (target.getValue() == null) != (max.getValue() == null),\n        \"Exactly one of \" + target.getName() + \" or \" + max.getName() + \" must be present\"\n    );\n\n    this.resolvedMaxRowPerSegment = resolveMaxRowsPerSegment(target, max);\n    this.targetRowsPerSegment = target.getValue();\n    this.maxRowsPerSegment = max.getValue();\n  }\n\n  private static int resolveMaxRowsPerSegment(Property<Integer> targetRows, Property<Integer> maxRows)\n  {\n    if (targetRows.getValue() != null) {\n      Preconditions.checkArgument(targetRows.getValue() > 0, targetRows.getName() + \" must be greater than 0\");\n      try {\n        return Math.addExact(targetRows.getValue(), (targetRows.getValue() / 2));\n      }\n      catch (ArithmeticException e) {\n        throw new IllegalArgumentException(targetRows.getName() + \" is too large\");\n      }\n    } else {\n      Preconditions.checkArgument(maxRows.getValue() > 0, maxRows.getName() + \" must be greater than 0\");\n      return maxRows.getValue();\n    }\n  }\n\n  @JsonProperty\n  @Override\n  @Nullable\n  public Integer getTargetRowsPerSegment()\n  {\n    return targetRowsPerSegment;\n  }\n\n  @Override\n  public SecondaryPartitionType getType()\n  {","sourceCodeStart":77,"sourceCodeEnd":113,"githubUrl":"https://github.com/apache/druid/blob/9b90983fd291f26935af934383ce360473179e4d/processing/src/main/java/org/apache/druid/indexer/partitions/DimensionRangePartitionsSpec.java#L77-L113","documentation":"DimensionRangePartitionsSpec.resolveMaxRowsPerSegment derives an effective max rows per segment as targetRowsPerSegment + targetRowsPerSegment/2 using Math.addExact. If that addition overflows an int, the target value was absurdly large (near Integer.MAX_VALUE), so it throws IAE '<name> is too large'.","triggerScenarios":"Setting targetRowsPerSegment (or the resolved sum) to a value greater than roughly Integer.MAX_VALUE/2 (about 1,073,741,823) in partitionsSpec config, causing Math.addExact to overflow.","commonSituations":"Misconfigured ingestion spec where targetRowsPerSegment was pasted as a huge number or in an unintended unit; generated specs computing partition sizes wrongly; typos adding extra digits.","solutions":["Set targetRowsPerSegment to a realistic value (thousands to a few hundred thousand), not hundreds of millions or more.","If you want no target and a hard cap, set maxRowsPerSegment instead and omit targetRowsPerSegment.","Validate the numeric value in your spec generator before writing the task JSON."],"exampleFix":"// before\n\"partitionsSpec\": {\"type\": \"range\", \"targetRowsPerSegment\": 2000000000}\n// after\n\"partitionsSpec\": {\"type\": \"range\", \"targetRowsPerSegment\": 3000000}","handlingStrategy":"validation","validationCode":"if (targetRowsPerSegment != null && targetRowsPerSegment > Integer.MAX_VALUE / 2) {\n  throw new IllegalArgumentException(\"targetRowsPerSegment is too large\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep targetRowsPerSegment in the tens-of-thousands to low-millions range","Use maxRowsPerSegment for hard caps instead of huge targets","Range-check numeric config values when generating specs programmatically"],"tags":["ingestion","partitioning","configuration","integer-overflow"],"backgroundTag":"value-out-of-range","analyzedSha":"9b90983fd291f26935af934383ce360473179e4d","analyzedAt":"2026-09-07T13:32:30.957Z","contentChangedAt":"2026-09-07T13:32:30.957Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}