{"record":{"id":"dde0f5d01d8ff423","repo":"apache/druid","slug":"floatanyaggregatorfactory-is-not-supported-during","errorCode":null,"errorMessage":"FloatAnyAggregatorFactory is not supported during ingestion for rollup","messagePattern":"FloatAnyAggregatorFactory 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/FloatAnyAggregatorFactory.java","lineNumber":148,"sourceCode":"  }\n\n  @Override\n  public Comparator getComparator()\n  {\n    return FloatSumAggregator.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(\"FloatAnyAggregatorFactory is not supported during ingestion for rollup\");\n  }\n\n\n  @Override\n  public AggregatorFactory getCombiningFactory()\n  {\n    return new FloatAnyAggregatorFactory(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 Float.parseFloat((String) object);\n    }\n    return object;\n  }","sourceCodeStart":130,"sourceCodeEnd":166,"githubUrl":"https://github.com/apache/druid/blob/9b90983fd291f26935af934383ce360473179e4d/processing/src/main/java/org/apache/druid/query/aggregation/any/FloatAnyAggregatorFactory.java#L130-L166","documentation":"FloatAnyAggregatorFactory cannot participate in rollup: the float 'any' aggregator has no deterministic combine semantics across cursors, so Druid's ingestion-time AggregateCombiner is intentionally unsupported and makeAggregateCombiner throws UOE with this message. Query-time use of floatAny remains fine; only rollup ingestion rejects it.","triggerScenarios":"Ingestion job with rollup enabled whose metricsSpec contains a float aggregator with fn \"any\" (floatAny); the incremental index construction calls makeAggregateCombiner and throws immediately.","commonSituations":"Copying a query spec into an ingestion metricsSpec; migrating legacy datasources that used any-aggregators at query time into rollup-based ingestion without changing the aggregator type.","solutions":["Replace floatAny in the metricsSpec with a rollup-supported aggregator (floatSum, floatMin, floatMax, floatFirst)","Disable rollup on the datasource if the exact arbitrary value must be preserved","Apply floatAny only at query time against already-rolled-up data","Use floatFirst as a deterministic stand-in when only one row rolls into each key"],"exampleFix":"// before\n\"metricsSpec\": [{ \"type\": \"floatAny\", \"name\": \"v\" }]\n// after\n\"metricsSpec\": [{ \"type\": \"floatSum\", \"name\": \"v\" }]  // or turn rollup off","handlingStrategy":"validation","validationCode":"boolean rollupSafe(IngestionSpec spec) {\n  return spec.metricsSpec.stream().noneMatch(a ->\n      \"floatAny\".equals(a.getType()) && spec.rollup);\n}","typeGuard":"boolean isRollupCompatible(AggregatorFactory f) {\n  return !(f instanceof FloatAnyAggregatorFactory);\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 floatAny with a rollup-compatible aggregator\");\n}","preventionTips":["Exclude floatAny from rollup ingestion specs; use floatSum/Min/Max/First","Apply any-aggregations only at query time","Turn rollup off when arbitrary value retention is a hard requirement","Audit templated/generated metricsSpec entries for any-aggregator types"],"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"}