{"record":{"id":"21ed7e8f077b86f6","repo":"pentaho/pentaho-kettle","slug":"unsupported-situation-detected-where-more-than-one-mapping-21ed7e","errorCode":null,"errorMessage":"Unsupported situation detected where more than one Mapping Output step needs to be handled.  To solve it, insert a dummy step after the mapping step.","messagePattern":"Unsupported situation detected where more than one Mapping Output step needs to be handled\\.  To solve it, insert a dummy step after the mapping step\\.","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/trans/steps/mapping/Mapping.java","lineNumber":153,"sourceCode":"\n          // Do the same thing for output row sets\n          //\n          List<RowSet> outputRowSets = getOutputRowSets();\n          if ( !outputRowSets.isEmpty() ) {\n            for ( RowSet rowSet : outputRowSets ) {\n              // Pass this rowset down to a mapping input step in the\n              // sub-transformation...\n              //\n              if ( mappingOutputs.length == 1 ) {\n                // Simple case: only one output mapping. Move the RowSet over\n                //\n                mappingOutputs[0].addRowSetToOutputRowSets( rowSet );\n              } else {\n                // Difficult to see what's going on here.\n                // TODO: figure out where this RowSet needs to go and where it\n                // comes from.\n                //\n                throw new KettleException(\n                    \"Unsupported situation detected where more than one Mapping Output step needs to be handled.  \"\n                        + \"To solve it, insert a dummy step after the mapping step.\" );\n              }\n            }\n            clearOutputRowSets();\n          }\n\n          // Do the same thing for remote output steps...\n          //\n          if ( !getRemoteOutputSteps().isEmpty() ) {\n            // The remote server is likely a master or a slave server sending data\n            // over remotely to this mapping.\n            // However, the data needs to end up at a Mapping Output step of the\n            // sub-transformation, not in this step.\n            // We can move over the remote steps to the Mapping Output step as long\n            // as the threads haven't started yet.\n            //\n            for ( RemoteStep remoteStep : getRemoteOutputSteps() ) {","sourceCodeStart":135,"sourceCodeEnd":171,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/trans/steps/mapping/Mapping.java#L135-L171","documentation":"In Mapping.processRow, output row sets can only be attached to mappingOutputs[0].addRowSetToOutputRowSets(...). If the sub-transformation defines more than one Mapping Output step, the destination is ambiguous and a KettleException is thrown. This mirrors the input-side check but for outputs, recommending a dummy step after the mapping.","triggerScenarios":"The Mapping step's sub-transformation contains two or more 'Mapping Output' steps and the parent transformation connects steps after the Mapping, so the resulting output row set cannot be assigned to a single Mapping Output — during output row set wiring in processRow.","commonSituations":"Sub-transformation built with conditional multi-output paths (multiple Mapping Outputs) reused with a simple Mapping step; leftover extra Mapping Output after refactoring the sub-transf.","solutions":["Insert a Dummy step between the Mapping step and the next step in the parent transformation.","Keep exactly one Mapping Output step in the sub-transformation; route multiple streams into it (via union/append) instead.","If multiple outputs are needed, use the 'Mapping (sub-transformation)' with explicit output specification rather than the simple Mapping step.","Audit the sub-transf for duplicate/unused Mapping Output steps and delete them."],"exampleFix":"// before\nMapping(sub.ktr) -----> TextFileOutput   // sub.ktr has MappingOutput1 and MappingOutput2\n// after\nMapping(sub.ktr) -----> Dummy -----> TextFileOutput  // or single MappingOutput in sub.ktr","handlingStrategy":"validation","validationCode":"// Inspect the sub-transformation before wiring outputs:\nlong outputs = subTransMeta.getSteps().stream()\n  .filter(s -> s.getStepMeta() instanceof MappingOutputMeta).count();\nif (outputs > 1) throw new IllegalStateException(\"Sub-transformation has \" + outputs + \" Mapping Output steps; add a Dummy after the Mapping or reduce to 1\");","typeGuard":null,"tryCatchPattern":"try {\n  trans.execute(null);\n} catch (KettleException e) {\n  if (e.getMessage().contains(\"more than one Mapping Output\")) {\n    log.error(\"Ambiguous mapping output wiring: insert a Dummy step after the Mapping step\", e);\n  } else { throw e; }\n}","preventionTips":["Keep one Mapping Output step per sub-transformation; union streams internally.","Delete leftover Mapping Output steps after refactoring.","Insert Dummy steps when connecting multiple downstream consumers.","Use explicit sub-transformation output specification for genuinely multi-output designs."],"tags":["mapping","sub-transformation","wiring","kettle"],"backgroundTag":"invalid-argument-value","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"}