{"record":{"id":"7574b9df80e47e14","repo":"apache/druid","slug":"illegal-bucketsize-s-must-be-0","errorCode":null,"errorMessage":"Illegal bucketSize [%s], must be > 0","messagePattern":"Illegal bucketSize \\[(.+?)\\], must be > 0","errorType":"validation","errorClass":"org.apache.druid.java.util.common.IAE","httpStatus":null,"severity":"error","filePath":"extensions-core/histogram/src/main/java/org/apache/druid/query/aggregation/histogram/BucketsPostAggregator.java","lineNumber":56,"sourceCode":"\n@JsonTypeName(\"buckets\")\npublic class BucketsPostAggregator extends ApproximateHistogramPostAggregator\n{\n  private final float bucketSize;\n  private final float offset;\n\n  @JsonCreator\n  public BucketsPostAggregator(\n      @JsonProperty(\"name\") String name,\n      @JsonProperty(\"fieldName\") String fieldName,\n      @JsonProperty(\"bucketSize\") float bucketSize,\n      @JsonProperty(\"offset\") float offset\n  )\n  {\n    super(name, fieldName);\n    this.bucketSize = bucketSize;\n    if (this.bucketSize <= 0) {\n      throw new IAE(\"Illegal bucketSize [%s], must be > 0\", this.bucketSize);\n    }\n    this.offset = offset;\n  }\n\n  @Override\n  public Set<String> getDependentFields()\n  {\n    return Sets.newHashSet(fieldName);\n  }\n\n  @Override\n  public Object compute(Map<String, Object> values)\n  {\n    ApproximateHistogram ah = (ApproximateHistogram) values.get(fieldName);\n    return ah.toHistogram(bucketSize, offset);\n  }\n\n  /**","sourceCodeStart":38,"sourceCodeEnd":74,"githubUrl":"https://github.com/apache/druid/blob/9b90983fd291f26935af934383ce360473179e4d/extensions-core/histogram/src/main/java/org/apache/druid/query/aggregation/histogram/BucketsPostAggregator.java#L38-L74","documentation":"Constructor-time argument validation in the 'buckets' post-aggregator: a BucketsPostAggregator was configured with a bucketSize that is zero or negative, so histogram buckets would have non-positive width. It fires at JSON-parsing/config-load time when the user-supplied bucketSize property is <= 0.","triggerScenarios":"Thrown at extensions-core/histogram/src/main/java/org/apache/druid/query/aggregation/histogram/BucketsPostAggregator.java:56 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set bucketSize to a positive value in the post-aggregator spec (e.g. \"bucketSize\": 0.5).","Check query JSON for a typo such as a negative or omitted bucketSize that defaults to 0."],"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"}