{"record":{"id":"98c9d30ef454a883","repo":"pentaho/pentaho-kettle","slug":"jobexecutor-incorrectdatatypepassed","errorCode":"JobExecutor.IncorrectDataTypePassed","errorMessage":"JobExecutor.IncorrectDataTypePassed","messagePattern":"JobExecutor\\.IncorrectDataTypePassed","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/trans/steps/jobexecutor/JobExecutor.java","lineNumber":321,"sourceCode":"      }\n      if ( !Utils.isEmpty( meta.getExecutionLogChannelIdField() ) ) {\n        outputRow[idx++] = data.executorJob.getLogChannelId();\n      }\n\n      putRowTo( data.executionResultsOutputRowMeta, outputRow, data.executionResultRowSet );\n    }\n\n    // Optionally also send the result rows to a specified target step...\n    //\n    if ( meta.getResultRowsTargetStepMeta() != null && result.getRows() != null ) {\n      for ( RowMetaAndData row : result.getRows() ) {\n\n        Object[] targetRow = RowDataUtil.allocateRowData( data.resultRowsOutputRowMeta.size() );\n\n        for ( int i = 0; i < meta.getResultRowsField().length; i++ ) {\n          ValueMetaInterface valueMeta = row.getRowMeta().getValueMeta( i );\n          if ( valueMeta.getType() != meta.getResultRowsType()[i] ) {\n            throw new KettleException( BaseMessages.getString(\n              PKG, \"JobExecutor.IncorrectDataTypePassed\", valueMeta.getTypeDesc(),\n              ValueMetaFactory.getValueMetaName( meta.getResultRowsType()[i] ) ) );\n          }\n\n          targetRow[i] = row.getData()[i];\n        }\n        putRowTo( data.resultRowsOutputRowMeta, targetRow, data.resultRowsRowSet );\n      }\n    }\n\n    if ( meta.getResultFilesTargetStepMeta() != null && result.getResultFilesList() != null ) {\n      for ( ResultFile resultFile : result.getResultFilesList() ) {\n        Object[] targetRow = RowDataUtil.allocateRowData( data.resultFilesOutputRowMeta.size() );\n        int idx = 0;\n        targetRow[idx++] = resultFile.getFile().getName().toString();\n\n        // TODO: time, origin, ...\n","sourceCodeStart":303,"sourceCodeEnd":339,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/trans/steps/jobexecutor/JobExecutor.java#L303-L339","documentation":"Thrown in executeJob when copying the job's result rows to the output stream: the actual data type of each result-row field (from the result row's value metadata) must exactly match the expected type configured in the step's 'result rows field type' settings. If the runtime type descriptor differs from the configured ValueMeta type, this error names both the received and expected type.","triggerScenarios":"The nested job's result rows contain a field whose ValueMetaInterface.getType() differs from meta.getResultRowsType()[i] configured in the step — e.g. configured as Number but the job's result row provides Integer or String.","commonSituations":"Job's result row structure changed (different transformation inside the nested job producing the result rows); step metadata copied from another environment; type edited in the step dialog (e.g. String vs Date) after the producing job changed; loosely-typed CSV-derived fields arriving as String.","solutions":["Open the JobExecutor step's 'Result rows' tab and set each field's type to match the type actually produced by the nested job","Inspect the nested job's result rows (e.g. with a 'Get rows from result' step) to confirm the real data types","Change the producing transformation/job to emit the expected type (e.g. add a Select values step converting the field)","Keep the field types in the step metadata in sync whenever the result-row producer changes"],"exampleFix":"// before (step expects Number, job result row delivers String 'amount')\nResult rows field 'amount', type: Number -> IncorrectDataTypePassed (String, Number)\n// after\nEither set step type to String, or in the producing transformation convert:\nSelect values: amount, String -> Number","handlingStrategy":"validation","validationCode":"// Verify result-row types match the step configuration before execution\nJobExecutorMeta meta = (JobExecutorMeta) stepMeta.getStepMetaInterface();\nfor ( int i = 0; i < meta.getResultRowsField().length; i++ ) {\n  String expected = ValueMetaFactory.getValueMetaName( meta.getResultRowsType()[i] );\n  // compare against the types actually emitted by the nested job's result rows\n  System.out.println(\"Field \" + meta.getResultRowsField()[i] + \" must be of type \" + expected);\n}","typeGuard":"boolean resultRowTypesMatch(RowMetaInterface resultRowMeta, JobExecutorMeta meta) {\n  for ( int i = 0; i < meta.getResultRowsField().length; i++ ) {\n    if ( resultRowMeta.getValueMeta(i).getType() != meta.getResultRowsType()[i] ) return false;\n  }\n  return true;\n}","tryCatchPattern":"try {\n  processJobResult();\n} catch ( KettleException e ) {\n  if ( e.getMessage().contains(\"IncorrectDataTypePassed\") ) {\n    logError(\"Result row type mismatch: \" + e.getMessage()\n      + \" — fix the Result rows type tab or convert the field upstream\");\n  } else { throw e; }\n}","preventionTips":["Whenever the nested job's result-row producer changes, re-check the JobExecutor 'Result rows' tab types","Use Select values steps to force explicit conversions before data reaches result rows","Avoid loosely typed sources (CSV, Excel) feeding result rows without an explicit type-conversion step","Document the expected result-row schema of the nested job so both sides stay in sync"],"tags":["pentaho-kettle","type-mismatch","result-rows","configuration"],"backgroundTag":"type-mismatch","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"}