prestodb/presto · error · UnsupportedOperationException

LEARN must run on a single machine

Error message

LEARN must run on a single machine

What it means

Unsupported-operation guard in LearnVarcharClassifierAggregation.combine: learn_classifier with varchar labels is non-decomposable, so merging partial aggregation states is unsupported. Encountering it indicates the planner attempted distributed execution of the SVM training.

Source

Thrown at presto-ml/src/main/java/com/facebook/presto/ml/LearnVarcharClassifierAggregation.java:46

@AggregationFunction(value = "learn_classifier", decomposable = false)
public final class LearnVarcharClassifierAggregation
{
    private LearnVarcharClassifierAggregation() {}

    @InputFunction
    public static void input(
            @AggregationState LearnState state,
            @SqlType(VARCHAR) Slice label,
            @SqlType("map(bigint,double)") Block features)
    {
        LearnLibSvmVarcharClassifierAggregation.input(state, label, features, Slices.utf8Slice(""));
    }

    @CombineFunction
    public static void combine(@AggregationState LearnState state, @AggregationState LearnState otherState)
    {
        throw new UnsupportedOperationException("LEARN must run on a single machine");
    }

    @OutputFunction("Classifier<varchar>")
    public static void output(@AggregationState LearnState state, BlockBuilder out)
    {
        LearnLibSvmVarcharClassifierAggregation.output(state, out);
    }
}

View on GitHub (pinned to 55bb57d202)

Solutions

  1. Execute the learn_classifier aggregation on a single machine
  2. Feed a single pre-merged input to the training function
  3. Avoid query shapes that produce partial aggregation for non-decomposable functions
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at presto-ml/src/main/java/com/facebook/presto/ml/LearnVarcharClassifierAggregation.java:46 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of prestodb/presto@55bb57d202 (2026-09-04). Data as JSON: /api/errors/7098ac51d0fe2ed5. Report an issue: GitHub.