{"record":{"id":"462f21637e7ca4b7","repo":"apache/druid","slug":"extractvalue-without-an-aggregator-factory-is-not","errorCode":null,"errorMessage":"extractValue without an aggregator factory is not supported.","messagePattern":"extractValue without an aggregator factory is not supported\\.","errorType":"exception","errorClass":"java.lang.UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"extensions-core/histogram/src/main/java/org/apache/druid/query/aggregation/histogram/FixedBucketsHistogramSerde.java","lineNumber":69,"sourceCode":"    return FixedBucketsHistogramAggregator.TYPE_NAME;\n  }\n\n  @Override\n  public ComplexMetricExtractor getExtractor()\n  {\n    return new ComplexMetricExtractor()\n    {\n      @Override\n      public Class<FixedBucketsHistogram> extractedClass()\n      {\n        return FixedBucketsHistogram.class;\n      }\n\n      @Nullable\n      @Override\n      public Object extractValue(InputRow inputRow, String metricName)\n      {\n        throw new UnsupportedOperationException(\"extractValue without an aggregator factory is not supported.\");\n      }\n\n      @Override\n      public FixedBucketsHistogram extractValue(InputRow inputRow, String metricName, AggregatorFactory agg)\n      {\n        Object rawValue = inputRow.getRaw(metricName);\n\n        FixedBucketsHistogramAggregatorFactory aggregatorFactory = (FixedBucketsHistogramAggregatorFactory) agg;\n\n        if (rawValue == null) {\n          FixedBucketsHistogram fbh = new FixedBucketsHistogram(\n              aggregatorFactory.getLowerLimit(),\n              aggregatorFactory.getUpperLimit(),\n              aggregatorFactory.getNumBuckets(),\n              aggregatorFactory.getOutlierHandlingMode()\n          );\n          fbh.incrementMissing();\n          return fbh;","sourceCodeStart":51,"sourceCodeEnd":87,"githubUrl":"https://github.com/apache/druid/blob/9b90983fd291f26935af934383ce360473179e4d/extensions-core/histogram/src/main/java/org/apache/druid/query/aggregation/histogram/FixedBucketsHistogramSerde.java#L51-L87","documentation":"The ColumnValueSelector created by FixedBucketsHistogramSerde.makeColumnValueSelector without an AggregatorFactory throws UnsupportedOperationException from extractValue(InputRow, String). The serde can only extract histogram values when it knows the expected aggregator factory (to deserialize/validate); the no-factory overload is intentionally unsupported for this complex type.","triggerScenarios":"Calling the two-argument extractValue(inputRow, metricName) on the selector produced by FixedBucketsHistogramSerde, or framework code that reads column values without passing the AggregatorFactory.","commonSituations":"Custom ingestion/stream-parsing code using the no-factory selector API against a fixedBucketsHistogram column; generic value-extraction utilities that ignore aggregator factories.","solutions":["Use the three-argument extractValue(inputRow, metricName, AggregatorFactory) overload, supplying the FixedBucketsHistogramAggregatorFactory.","Ensure ingestion paths that materialize column values pass the aggregator factory so the serde can decode base64/JSON histograms.","If only raw values are needed, use inputRow.getRaw(metricName) instead of the selector's extractValue."],"exampleFix":"// before\nObject v = selector.extractValue(row, \"myHist\");\n// after\nObject v = selector.extractValue(row, \"myHist\", new FixedBucketsHistogramAggregatorFactory(...));","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  Object v = selector.extractValue(row, metricName);\n} catch (UnsupportedOperationException e) {\n  Object v = selector.extractValue(row, metricName, aggregatorFactory);\n}","preventionTips":["Always call the AggregatorFactory overload when working with fixedBucketsHistogram columns.","Use inputRow.getRaw() when only the raw serialized value is needed.","Keep custom ingestion code aware that this serde requires factory context for extraction."],"tags":["druid","histogram","serde","unsupported-operation"],"backgroundTag":"method-not-implemented","analyzedSha":"9b90983fd291f26935af934383ce360473179e4d","analyzedAt":"2026-09-07T13:32:30.957Z","contentChangedAt":"2026-09-07T13:32:30.957Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}