{"record":{"id":"650d852690c5b389","repo":"apache/druid","slug":"doubleanyaggregatorfactory-is-not-supported-during","errorCode":null,"errorMessage":"DoubleAnyAggregatorFactory is not supported during ingestion for rollup","messagePattern":"DoubleAnyAggregatorFactory is not supported during ingestion for rollup","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"processing/src/main/java/org/apache/druid/query/aggregation/any/DoubleAnyAggregatorFactory.java","lineNumber":151,"sourceCode":"  }\n\n  @Override\n  public Comparator getComparator()\n  {\n    return DoubleSumAggregator.COMPARATOR;\n  }\n\n  @Override\n  @Nullable\n  public Object combine(@Nullable Object lhs, @Nullable Object rhs)\n  {\n    return lhs;\n  }\n\n  @Override\n  public AggregateCombiner makeAggregateCombiner()\n  {\n    throw new UOE(\"DoubleAnyAggregatorFactory is not supported during ingestion for rollup\");\n  }\n\n  @Override\n  public AggregatorFactory getCombiningFactory()\n  {\n    return new DoubleAnyAggregatorFactory(name, name);\n  }\n\n  @Override\n  public Object deserialize(Object object)\n  {\n    // handle \"NaN\" / \"Infinity\" values serialized as strings in JSON\n    if (object instanceof String) {\n      return Double.parseDouble((String) object);\n    }\n    return object;\n  }\n","sourceCodeStart":133,"sourceCodeEnd":169,"githubUrl":"https://github.com/apache/druid/blob/9b90983fd291f26935af934383ce360473179e4d/processing/src/main/java/org/apache/druid/query/aggregation/any/DoubleAnyAggregatorFactory.java#L133-L169","documentation":"DoubleAnyAggregatorFactory cannot be used for rollup at ingestion time: the 'any' aggregator keeps only the last-seen value and has no deterministic combiner that Druid's rollup machinery (AggregateCombiner) can use to merge across cursors. makeAggregateCombiner therefore throws UOE (UnsupportedOperationException) with this message. This is a deliberate guard, not a bug.","triggerScenarios":"Running ingestion (batch or streaming) with rollup enabled and an aggregator of type \"double\" with fn \"any\" (or type \"doubleAny\") in the metricsSpec; Druid calls makeAggregateCombiner while building the incremental index and immediately throws.","commonSituations":"Migrating a query-time doubleAny aggregator into an ingestion spec assuming it works there; building rollup tables where users copy query aggregators verbatim into metricsSpec.","solutions":["Remove doubleAny from the rollup metricsSpec; use a supported aggregator like doubleSum, doubleMin, doubleMax, or doubleFirst/last depending on intent","If you need to keep an arbitrary value, disable rollup for that datasource so raw rows are stored","Store the raw metric in rollup with a deterministic aggregator and apply doubleAny only at query time on the rolled-up data","If only one row can match a rollup key in practice, doubleFirst may be an acceptable deterministic substitute"],"exampleFix":"// before\n\"metricsSpec\": [{ \"type\": \"doubleAny\", \"name\": \"v\" }]\n// after\n\"metricsSpec\": [{ \"type\": \"doubleSum\", \"name\": \"v\" }]  // or disable rollup","handlingStrategy":"validation","validationCode":"// Java: validate spec before submitting ingestion\nboolean rollupSafe(IngestionSpec spec) {\n  return spec.metricsSpec.stream().noneMatch(a ->\n      \"doubleAny\".equals(a.getType()) && spec.rollup); \n}","typeGuard":"boolean isRollupCompatible(AggregatorFactory f) {\n  return !(f instanceof DoubleAnyAggregatorFactory);\n}","tryCatchPattern":"try {\n  indexBuilder.addAggregator(factory);\n} catch (UnsupportedOperationException e) {\n  LOGGER.error(e, \"Aggregator %s unsupported for rollup ingestion\", factory.getName());\n  throw new ISE(\"Replace any-aggregator with a rollup-compatible one\");\n}","preventionTips":["Never put any-aggregators (doubleAny/floatAny/longAny) in a rollup metricsSpec","Use doubleSum/Min/Max/First for rollup; reserve doubleAny for query time","Disable rollup when arbitrary last-value semantics are required","Review generated ingestion specs for aggregator types before submitting"],"tags":["ingestion","rollup","unsupported-operation","druid"],"backgroundTag":"unsupported-operation","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"}