{"record":{"id":"f9d742a79e9f1b30","repo":"pentaho/pentaho-kettle","slug":"tablecompare-exception-excludefieldsnotspecified","errorCode":null,"errorMessage":"TableCompare.Exception.ExcludeFieldsNotSpecified","messagePattern":"TableCompare\\.Exception\\.ExcludeFieldsNotSpecified","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/trans/steps/tablecompare/TableCompare.java","lineNumber":136,"sourceCode":"        throw new KettleException( BaseMessages.getString( PKG, \"TableCompare.Exception.CanNotFindField\", meta\n          .getCompareTableField() ) );\n      }\n\n      // Key fields\n      //\n      if ( Utils.isEmpty( meta.getKeyFieldsField() ) ) {\n        throw new KettleException( BaseMessages.getString( PKG, \"TableCompare.Exception.KeyFieldsNotSpecified\" ) );\n      }\n      data.keyFieldsIndex = getInputRowMeta().indexOfValue( meta.getKeyFieldsField() );\n      if ( data.keyFieldsIndex < 0 ) {\n        throw new KettleException( BaseMessages.getString( PKG, \"TableCompare.Exception.CanNotFindField\", meta\n          .getKeyFieldsField() ) );\n      }\n\n      // Exclude fields\n      //\n      if ( Utils.isEmpty( meta.getExcludeFieldsField() ) ) {\n        throw new KettleException( BaseMessages\n          .getString( PKG, \"TableCompare.Exception.ExcludeFieldsNotSpecified\" ) );\n      }\n      data.excludeFieldsIndex = getInputRowMeta().indexOfValue( meta.getExcludeFieldsField() );\n      if ( data.excludeFieldsIndex < 0 ) {\n        throw new KettleException( BaseMessages.getString( PKG, \"TableCompare.Exception.CanNotFindField\", meta\n          .getExcludeFieldsField() ) );\n      }\n\n      // error handling: Key description\n      //\n      if ( Utils.isEmpty( meta.getKeyDescriptionField() ) ) {\n        throw new KettleException( BaseMessages.getString(\n          PKG, \"TableCompare.Exception.KeyDescriptionFieldNotSpecified\" ) );\n      }\n      data.keyDescIndex = getInputRowMeta().indexOfValue( meta.getKeyDescriptionField() );\n      if ( data.keyDescIndex < 0 ) {\n        throw new KettleException( BaseMessages.getString( PKG, \"TableCompare.Exception.CanNotFindField\", meta\n          .getKeyDescriptionField() ) );","sourceCodeStart":118,"sourceCodeEnd":154,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/trans/steps/tablecompare/TableCompare.java#L118-L154","documentation":"TableCompare.processRow() requires the 'Exclude fields' setting and throws this KettleException (ExcludeFieldsNotSpecified) when meta.getExcludeFieldsField() is empty. This is a required-configuration guard, identical in shape to the KeyFieldsNotSpecified check. Without the exclude-fields column the step cannot know which fields to omit from comparison per row.","triggerScenarios":"Utils.isEmpty(meta.getExcludeFieldsField()) is true in processRow() — the 'Exclude fields fieldname' entry in the TableCompare dialog is blank or null when the transform starts.","commonSituations":"Programmatic construction of TableCompareMeta (tests, metadata injection) skipping setExcludeFieldsField(); a dialog saved incompletely; migrating transformations where the setting was lost.","solutions":["Set 'Exclude fields fieldname' in the TableCompare dialog to a field in the input stream.","In code, call meta.setExcludeFieldsField(\"...\") before execution; consider meta.setDefault() to populate required defaults.","Add a pre-execution metadata check that asserts every required field-name setting is non-empty."],"exampleFix":"// before\nTableCompareMeta meta = new TableCompareMeta();\nmeta.setCompareTableField( \"compare_table\" );\nmeta.setKeyFieldsField( \"key_fields\" ); // exclude fields never set\n// after\nmeta.setExcludeFieldsField( \"exclude_fields\" );","handlingStrategy":"validation","validationCode":"if ( meta.getExcludeFieldsField() == null || meta.getExcludeFieldsField().isEmpty() ) {\n  throw new IllegalStateException( \"TableCompare: Exclude fields fieldname is required\" );\n}","typeGuard":null,"tryCatchPattern":"try {\n  step.processRow();\n} catch ( KettleException e ) {\n  if ( String.valueOf( e.getLocalizedMessage() ).contains( \"ExcludeFieldsNotSpecified\" ) ) {\n    logError( \"Set 'Exclude fields fieldname' in the TableCompare dialog and rerun\" );\n  }\n  setErrors( 1 );\n  stopAll();\n}","preventionTips":["Set every required field name when constructing TableCompareMeta in tests or injected metadata.","Run meta.setDefault() to fill defaults before execution.","Validate transformation metadata at load time rather than at row-processing time."],"tags":["kettle","missing-config","transform-step"],"backgroundTag":"missing-required-argument","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"}