apache/druid · error · UnsupportedOperationException
LongAnyAggregatorFactory is not supported during ingestion f
Error message
LongAnyAggregatorFactory is not supported during ingestion for rollup
What it means
LongAnyAggregatorFactory cannot be used during rollup ingestion: like the other 'any' aggregators, it keeps an arbitrary last-seen value with no deterministic combiner, so makeAggregateCombiner throws UOE with this message. Druid rejects this early, while building the aggregator for the incremental index.
Source
Thrown at processing/src/main/java/org/apache/druid/query/aggregation/any/LongAnyAggregatorFactory.java:147
}
@Override
public Comparator getComparator()
{
return LongSumAggregator.COMPARATOR;
}
@Override
@Nullable
public Object combine(@Nullable Object lhs, @Nullable Object rhs)
{
return lhs;
}
@Override
public AggregateCombiner makeAggregateCombiner()
{
throw new UOE("LongAnyAggregatorFactory is not supported during ingestion for rollup");
}
@Override
public AggregatorFactory getCombiningFactory()
{
return new LongAnyAggregatorFactory(name, name);
}
@Override
public Object deserialize(Object object)
{
// handle "NaN" / "Infinity" values serialized as strings in JSON
if (object instanceof String) {
return Float.parseFloat((String) object);
}
return object;
}
View on GitHub (pinned to 9b90983fd2)
Solutions
- Swap longAny for a rollup-supported aggregator such as longSum, longMin, longMax, or longFirst in the metricsSpec
- Disable rollup if the arbitrary last value must be kept exactly
- Use longAny only at query time on top of rolled-up or raw segments
- Use longFirst when the rollup key is guaranteed to map to a single row
Example fix
// before
"metricsSpec": [{ "type": "longAny", "name": "v" }]
// after
"metricsSpec": [{ "type": "longSum", "name": "v" }] // or disable rollup Defensive patterns
Strategy: validation
Validate before calling
boolean rollupSafe(IngestionSpec spec) {
return spec.metricsSpec.stream().noneMatch(a ->
"longAny".equals(a.getType()) && spec.rollup);
} Type guard
boolean isRollupCompatible(AggregatorFactory f) {
return !(f instanceof LongAnyAggregatorFactory);
} Try / catch
try {
indexBuilder.addAggregator(factory);
} catch (UnsupportedOperationException e) {
LOGGER.error(e, "Aggregator %s unsupported for rollup ingestion", factory.getName());
throw new ISE("Replace longAny with a rollup-compatible aggregator");
} Prevention
- Use longSum/Min/Max/First in rollup metricsSpec instead of longAny
- Keep any-aggregators at the query layer only
- Disable rollup if the exact last value must persist
- Validate auto-generated ingestion specs before job submission
When it happens
Trigger: Ingestion with rollup enabled and a metricsSpec containing a long aggregator with fn "any" (longAny); Druid calls makeAggregateCombiner during index creation and throws.
Common situations: Users copying longAny from a native query into an ingestion spec; schema tooling or migrations that auto-generate metricsSpec entries from previous query aggregations.
Understand the failure class
Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.
Related errors
- DoubleAnyAggregatorFactory is not supported during ingestion
- FloatAnyAggregatorFactory is not supported during ingestion
- Bloom filter aggregators are query-time only
- %s cannot be used for perfect rollup
- Not implemented
AI-assisted analysis of apache/druid@9b90983fd2 (2026-09-07).
Data as JSON: /api/errors/58712965c7e6833e.
Report an issue: GitHub.