{"record":{"id":"14371a3927a146a0","repo":"pentaho/pentaho-kettle","slug":"the-simple-mapping-step-does-not-support-multiple-mapping","errorCode":null,"errorMessage":"The simple mapping step does not support multiple Mapping Input steps to write to in the sub-transformation","messagePattern":"The simple mapping step does not support multiple Mapping Input steps to write to in the sub-transformation","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/trans/steps/simplemapping/SimpleMapping.java","lineNumber":184,"sourceCode":"    // init is done.\n    //\n    try {\n      simpleMappingData.mappingTrans.prepareExecution( getTrans().getArguments() );\n    } catch ( KettleException e ) {\n      throw new KettleException( BaseMessages.getString( PKG,\n          \"SimpleMapping.Exception.UnableToPrepareExecutionOfMapping\" ), e );\n    }\n\n    // If there is no read/write logging step set, we can insert the data from\n    // the first mapping input/output step...\n    //\n    MappingInput[] mappingInputs = simpleMappingData.mappingTrans.findMappingInput();\n    if ( mappingInputs.length == 0 ) {\n      throw new KettleException(\n        \"The simple mapping step needs one Mapping Input step to write to in the sub-transformation\" );\n    }\n    if ( mappingInputs.length > 1 ) {\n      throw new KettleException(\n        \"The simple mapping step does not support multiple Mapping Input steps to write to in the sub-transformation\" );\n    }\n    simpleMappingData.mappingInput = mappingInputs[0];\n    simpleMappingData.mappingInput.setConnectorSteps( new StepInterface[0], new ArrayList<MappingValueRename>(), null );\n\n    // LogTableField readField = data.mappingTransMeta.getTransLogTable().findField(TransLogTable.ID.LINES_READ);\n    // if (readField.getSubject() == null) {\n    // readField.setSubject(data.mappingInput.getStepMeta());\n    // }\n\n    MappingOutput[] mappingOutputs = simpleMappingData.mappingTrans.findMappingOutput();\n    if ( mappingOutputs.length == 0 ) {\n      throw new KettleException(\n          \"The simple mapping step needs one Mapping Output step to read from in the sub-transformation\" );\n    }\n    if ( mappingOutputs.length > 1 ) {\n      throw new KettleException( \"The simple mapping step does not support \"\n          + \"multiple Mapping Output steps to read from in the sub-transformation\" );","sourceCodeStart":166,"sourceCodeEnd":202,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/trans/steps/simplemapping/SimpleMapping.java#L166-L202","documentation":"SimpleMapping supports exactly one Mapping Input step in the sub-transformation. If findMappingInput() returns more than one, this KettleException is thrown because the parent step cannot decide where to write incoming rows.","triggerScenarios":"prepareMappingExecution (from init) finds 2+ Mapping Input steps in the sub-transformation referenced by the Simple Mapping step.","commonSituations":"Copy-pasting the Mapping Input step inside a mapping to branch data; merging mappings that each had their own Mapping Input; using the full 'Mapping' step behavior expectations in a 'Simple Mapping' step.","solutions":["Remove extra Mapping Input steps so exactly one remains in the sub-transformation","If multiple inputs are needed, switch to the full 'Mapping' step which supports multiple input streams","Branch after the single Mapping Input instead of duplicating it"],"exampleFix":"// before (sub-transformation)\n[Mapping Input A] -> ... ; [Mapping Input B] -> ...\n// after\n[Mapping Input] -> ... ; [Mapping Input] removed","handlingStrategy":"validation","validationCode":"TransMeta sub = new TransMeta(mappingPath);\nlong count = sub.getSteps().stream().filter(s -> \"MappingInput\".equals(s.getTypeId())).count();\nif (count > 1) throw new IllegalArgumentException(\"simple mapping allows only one Mapping Input, found \" + count);","typeGuard":null,"tryCatchPattern":"try { trans.execute(null); } catch (KettleException e) { if (e.getMessage().contains(\"does not support multiple Mapping Input\")) { /* switch to full Mapping step or deduplicate */ } else throw e; }","preventionTips":["Keep exactly one Mapping Input per simple mapping","Use the full Mapping step when multiple inputs are required","Review duplicated steps after copy-paste edits in mappings"],"tags":["kettle","pdi","mapping","sub-transformation","mapping-input"],"backgroundTag":"unsupported-operation","analyzedSha":"f3058517a153da500bf4551f46d79b91bf8ec552","analyzedAt":"2026-09-13T14:04:16.340Z","contentChangedAt":"2026-09-13T14:04:16.340Z","schemaVersion":2},"datasetVersion":"2026-09-20T23:17:15.980Z"}