{"record":{"id":"150f7458f0973986","repo":"pentaho/pentaho-kettle","slug":"switchcase-log-unabletofindtargetrowsetforstep","errorCode":"SwitchCase.Log.UnableToFindTargetRowSetForStep","errorMessage":"SwitchCase.Log.UnableToFindTargetRowSetForStep","messagePattern":"SwitchCase\\.Log\\.UnableToFindTargetRowSetForStep","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/trans/steps/switchcase/SwitchCase.java","lineNumber":179,"sourceCode":"      StepIOMetaInterface ioMeta = meta.getStepIOMeta();\n\n      // There is one or many case target for each target stream.\n      // The ioMeta object has one more target stream for the default target though.\n      //\n      List<StreamInterface> targetStreams = ioMeta.getTargetStreams();\n      for ( int i = 0; i < targetStreams.size(); i++ ) {\n        SwitchCaseTarget target = (SwitchCaseTarget) targetStreams.get( i ).getSubject();\n        if ( target == null ) {\n          break; // Skip over default option\n        }\n        if ( target.caseTargetStep == null ) {\n          throw new KettleException( BaseMessages.getString(\n            PKG, \"SwitchCase.Log.NoTargetStepSpecifiedForValue\", target.caseValue ) );\n        }\n\n        RowSet rowSet = findOutputRowSet( target.caseTargetStep.getName() );\n        if ( rowSet == null ) {\n          throw new KettleException( BaseMessages.getString(\n            PKG, \"SwitchCase.Log.UnableToFindTargetRowSetForStep\", target.caseTargetStep ) );\n        }\n\n        try {\n          Object value =\n            data.valueMeta.convertDataFromString(\n              target.caseValue, data.stringValueMeta, null, null, ValueMetaInterface.TRIM_TYPE_NONE );\n\n          // If we have a value and a rowset, we can store the combination in the map\n          //\n          if ( data.valueMeta.isNull( value ) ) {\n            data.nullRowSetSet.add( rowSet );\n          } else {\n            // could not use byte[] as key in Maps, so we need to convert it to his specific hashCode for future\n            // comparisons\n            value = prepareObjectType( value );\n            data.outputMap.put( value, rowSet );\n          }","sourceCodeStart":161,"sourceCodeEnd":197,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/trans/steps/switchcase/SwitchCase.java#L161-L197","documentation":"KettleException thrown by SwitchCase.createOutputValueMapping when findOutputRowSet(target.caseTargetStep.getName()) returns null, meaning the RowSet for the configured target step could not be found among this step's output hops. The message includes the target step. This indicates the target step exists in metadata but is not actually connected as an output hop at runtime.","triggerScenarios":"The case target step was disconnected from the Switch/Case step (hop removed) while the mapping still references it; the target step name in metadata differs from the runtime step; or the transformation's hop structure changed without re-saving the Switch/Case mappings.","commonSituations":"Dragging/re-wiring hops in Spoon and leaving stale mappings; importing a transformation where hops failed to be created; conditional/target step disabled during execution so no row set was created for it.","solutions":["Reconnect the Switch/Case step to each configured target step with an output hop and save.","Open the Switch/Case dialog and re-select the target steps so mappings point to steps actually wired in the canvas.","Check that target steps are not disabled/removed at runtime.","Re-save and re-run the transformation after restructuring hops to flush stale references."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// confirm each target step is connected as an output hop\nfor ( SwitchCaseTarget t : meta.getCaseTargets() ) {\n  StepMeta sm = transMeta.findStep( t.getCaseTargetStepname() );\n  if ( sm == null || !transMeta.isStepConnectedTo( meta.getStepMeta(), sm ) )\n    throw new KettleException( \"Target not connected: \" + t.getCaseTargetStepname() );\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Re-check Switch/Case mappings after rewiring hops.","Keep target steps enabled.","Re-save the transformation after structural changes.","Use the transformation validator/check steps before execution."],"tags":["kettle","switch-case","rowset","hop"],"backgroundTag":"resource-not-found","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"}