{"record":{"id":"bef11b806936e38c","repo":"pentaho/pentaho-kettle","slug":"gettablenames-log-noschemafield","errorCode":"GetTableNames.Log.NoSchemaField","errorMessage":"GetTableNames.Log.NoSchemaField","messagePattern":"GetTableNames\\.Log\\.NoSchemaField","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/trans/steps/gettablenames/GetTableNames.java","lineNumber":88,"sourceCode":"      if ( data.readrow == null ) {\n        setOutputDone();\n        return false;\n      }\n    }\n\n    if ( first ) {\n      first = false;\n\n      if ( meta.isDynamicSchema() ) {\n        data.inputRowMeta = getInputRowMeta();\n        data.outputRowMeta = data.inputRowMeta.clone();\n        // Get total previous fields\n        data.totalpreviousfields = data.inputRowMeta.size();\n\n        // Check is filename field is provided\n        if ( Utils.isEmpty( meta.getSchemaFieldName() ) ) {\n          logError( BaseMessages.getString( PKG, \"GetTableNames.Log.NoSchemaField\" ) );\n          throw new KettleException( BaseMessages.getString( PKG, \"GetTableNames.Log.NoSchemaField\" ) );\n        }\n\n        // cache the position of the field\n        if ( data.indexOfSchemaField < 0 ) {\n          data.indexOfSchemaField = data.inputRowMeta.indexOfValue( meta.getSchemaFieldName() );\n          if ( data.indexOfSchemaField < 0 ) {\n            // The field is unreachable !\n            logError( BaseMessages.getString( PKG, \"GetTableNames.Log.ErrorFindingField\" )\n              + \"[\" + meta.getSchemaFieldName() + \"]\" );\n            throw new KettleException( BaseMessages.getString(\n              PKG, \"GetTableNames.Exception.CouldnotFindField\", meta.getSchemaFieldName() ) );\n          }\n        }\n\n      } else {\n        data.outputRowMeta = new RowMeta();\n      }\n","sourceCodeStart":70,"sourceCodeEnd":106,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/trans/steps/gettablenames/GetTableNames.java#L70-L106","documentation":"The Get Table Names step can read schema names dynamically from an incoming field, but processRow requires that field to be configured. When the 'schema fieldname' setting is empty, the step logs and throws this localized KettleException instead of continuing. It is a pure configuration validation error at row-processing time.","triggerScenarios":"Executing a transformation whose GetTableNames step has a dynamic schema lookup enabled (or expects input-driven schema) but the 'schema fieldname' property was never filled in the step dialog, so meta.getSchemaFieldName() returns empty at processRow.","commonSituations":"Step copied from another transformation without reconfiguration; transformation built programmatically where setSchemaFieldName was never called; upgrading an old .ktr where the field name was lost.","solutions":["Open the Get Table Names step dialog and set the 'schema fieldname' to the incoming field that contains the schema name.","If schemas should not be dynamic, disable the dynamic-schema option so the field is not required.","In code, call meta.setSchemaFieldName(\"schemaField\") before running the transformation.","Add a preceding step that guarantees the schema-name field exists in the row stream."],"exampleFix":"// before: running with empty schema field\nGetTableNamesMeta meta = (GetTableNamesMeta) stepMeta.getStepMetaInterface();\nmeta.setDynamicSchema( true ); // schemaFieldName left null\n// after\nGetTableNamesMeta meta = (GetTableNamesMeta) stepMeta.getStepMetaInterface();\nmeta.setDynamicSchema( true );\nmeta.setSchemaFieldName( \"schema_name\" ); // must match an incoming field","handlingStrategy":"validation","validationCode":"if ( meta.isDynamicSchema() && Utils.isEmpty( meta.getSchemaFieldName() ) ) {\n  throw new IllegalArgumentException( \"schemaFieldName must be set for dynamic schema\" );\n}","typeGuard":null,"tryCatchPattern":"try {\n  trans.execute( null );\n} catch ( KettleException e ) {\n  if ( e.getMessage().contains( \"NoSchemaField\" ) ) {\n    logError( \"Configure the schema fieldname in the Get Table Names step\" );\n  }\n}","preventionTips":["Always fill 'schema fieldname' when enabling dynamic schema in the dialog.","Use Spoon's step validation/check before scheduling transformations.","In generated transformations, assert required meta fields are set before execution."],"tags":["kettle","configuration","validation","missing-field"],"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"}