{"record":{"id":"4bddf35820363e90","repo":"prestodb/presto","slug":"learn-must-run-on-a-single-machine-4bddf3","errorCode":null,"errorMessage":"LEARN must run on a single machine","messagePattern":"LEARN must run on a single machine","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"presto-ml/src/main/java/com/facebook/presto/ml/LearnLibSvmRegressorAggregation.java","lineNumber":63,"sourceCode":"\n    @InputFunction\n    public static void input(\n            @AggregationState LearnState state,\n            @SqlType(DOUBLE) double label,\n            @SqlType(\"map(bigint,double)\") Block features,\n            @SqlType(VARCHAR) Slice parameters)\n    {\n        state.getLabels().add(label);\n        FeatureVector featureVector = ModelUtils.toFeatures(features);\n        state.addMemoryUsage(featureVector.getEstimatedSize());\n        state.getFeatureVectors().add(featureVector);\n        state.setParameters(parameters);\n    }\n\n    @CombineFunction\n    public static void combine(@AggregationState LearnState state, @AggregationState LearnState otherState)\n    {\n        throw new UnsupportedOperationException(\"LEARN must run on a single machine\");\n    }\n\n    @OutputFunction(RegressorType.NAME)\n    public static void output(@AggregationState LearnState state, BlockBuilder out)\n    {\n        Dataset dataset = new Dataset(state.getLabels(), state.getFeatureVectors(), state.getLabelEnumeration().inverse());\n        Model model = new RegressorFeatureTransformer(new SvmRegressor(LibSvmUtils.parseParameters(state.getParameters().toStringUtf8())), new FeatureUnitNormalizer());\n        model.train(dataset);\n        RegressorType.REGRESSOR.writeSlice(out, ModelUtils.serialize(model));\n    }\n}\n","sourceCodeStart":45,"sourceCodeEnd":75,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-ml/src/main/java/com/facebook/presto/ml/LearnLibSvmRegressorAggregation.java#L45-L75","documentation":"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.","triggerScenarios":"Thrown at presto-ml/src/main/java/com/facebook/presto/ml/LearnLibSvmRegressorAggregation.java:63 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Force single-machine execution of the learn_regressor aggregation","Train on pre-aggregated data fed to one worker","Use a custom single-node training path instead of distributed aggregation"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"55bb57d202de3b926896fa966c2c4a44c779634e","analyzedAt":"2026-09-04T12:50:26.162Z","contentChangedAt":"2026-09-04T12:50:26.162Z","schemaVersion":2},"datasetVersion":"2026-09-11T21:17:09.523Z"}