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 the ML LEARN regressor aggregation (learn_regressor): combine() must never be invoked because the aggregation is non-decomposable; partial states cannot be merged across machines. The error signals an attempt to run the SVM training in distributed fashion.

Source

Thrown at presto-ml/src/main/java/com/facebook/presto/ml/LearnLibSvmRegressorAggregation.java:63

    @InputFunction
    public static void input(
            @AggregationState LearnState state,
            @SqlType(DOUBLE) double label,
            @SqlType("map(bigint,double)") Block features,
            @SqlType(VARCHAR) Slice parameters)
    {
        state.getLabels().add(label);
        FeatureVector featureVector = ModelUtils.toFeatures(features);
        state.addMemoryUsage(featureVector.getEstimatedSize());
        state.getFeatureVectors().add(featureVector);
        state.setParameters(parameters);
    }

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

    @OutputFunction(RegressorType.NAME)
    public static void output(@AggregationState LearnState state, BlockBuilder out)
    {
        Dataset dataset = new Dataset(state.getLabels(), state.getFeatureVectors(), state.getLabelEnumeration().inverse());
        Model model = new RegressorFeatureTransformer(new SvmRegressor(LibSvmUtils.parseParameters(state.getParameters().toStringUtf8())), new FeatureUnitNormalizer());
        model.train(dataset);
        RegressorType.REGRESSOR.writeSlice(out, ModelUtils.serialize(model));
    }
}

View on GitHub (pinned to 55bb57d202)

Solutions

  1. Force single-machine execution of the learn_regressor aggregation
  2. Train on pre-aggregated data fed to one worker
  3. Use a custom single-node training path instead of distributed aggregation
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at presto-ml/src/main/java/com/facebook/presto/ml/LearnLibSvmRegressorAggregation.java:63 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/4bddf35820363e90. Report an issue: GitHub.