{"record":{"id":"98e2aa7b40fe07ab","repo":"apache/druid","slug":"expected-a-long-or-a-spectatorhistogrammap-but-re","errorCode":null,"errorMessage":"Expected a long or a SpectatorHistogramMap, but received [%s] of type [%s]","messagePattern":"Expected a long or a SpectatorHistogramMap, but received \\[(.+?)\\] of type \\[(.+?)\\]","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"extensions-contrib/spectator-histogram/src/main/java/org/apache/druid/spectator/histogram/SpectatorHistogramAggregator.java","lineNumber":65,"sourceCode":"\n  @Override\n  public void aggregate()\n  {\n    Object obj = selector.getObject();\n    if (obj == null) {\n      return;\n    }\n    if (obj instanceof SpectatorHistogram) {\n      SpectatorHistogram other = (SpectatorHistogram) obj;\n      synchronized (this) {\n        counts.merge(other);\n      }\n    } else if (obj instanceof Number) {\n      synchronized (this) {\n        counts.insert((Number) obj);\n      }\n    } else {\n      throw new IAE(\n          \"Expected a long or a SpectatorHistogramMap, but received [%s] of type [%s]\",\n          obj,\n          obj.getClass()\n      );\n    }\n  }\n\n  @Nullable\n  @Override\n  public synchronized Object get()\n  {\n    return counts.isEmpty() ? null : counts;\n  }\n\n  @Override\n  public synchronized float getFloat()\n  {\n    return counts.getSum();","sourceCodeStart":47,"sourceCodeEnd":83,"githubUrl":"https://github.com/apache/druid/blob/9b90983fd291f26935af934383ce360473179e4d/extensions-contrib/spectator-histogram/src/main/java/org/apache/druid/spectator/histogram/SpectatorHistogramAggregator.java#L47-L83","documentation":"SpectatorHistogramAggregator.aggregate received a selector value that is neither a Number nor a SpectatorHistogram. The aggregator expects either a plain long/numeric value or a histogram object produced by the matching column serializer; any other object (e.g. a String, Map, or a histogram from an incompatible serializer) is rejected, indicating a column-type/aggregator mismatch in the query spec.","triggerScenarios":"Thrown at extensions-contrib/spectator-histogram/src/main/java/org/apache/druid/spectator/histogram/SpectatorHistogramAggregator.java:65 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the query's aggregator spec: the spectatorHistogram aggregator must target a column serialized as SpectatorHistogram or numeric values.","Verify the input source's column type matches (e.g. not a string or complex type from another extension).","Inspect the logged object's type to identify which serializer produced the unexpected value.","Fix the query or the ingestion spec so the column's serialization matches the aggregator's expectations."],"exampleFix":null,"handlingStrategy":"type-guard","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"}