pentaho/pentaho-kettle · error · KettleStepException

ConcatFieldsMeta.CheckResult.TargetFieldNameMissing

ConcatFieldsMeta.CheckResult.TargetFieldNameMissing

Error message

ConcatFieldsMeta.CheckResult.TargetFieldNameMissing

What it means

ConcatFieldsMeta.getFields() builds the output row layout and requires a target field name to add the concatenated ValueMetaString. If targetFieldName is empty, it throws this KettleStepException before producing fields.

Solutions

  1. Set the Target field name in the step dialog before running.
  2. In code, call meta.setTargetFieldName("myField") before getFields.
  3. Validate the transformation (which runs step checks) before execution.

Example fix

// before
ConcatFieldsMeta meta = new ConcatFieldsMeta(); // targetFieldName empty
// after
ConcatFieldsMeta meta = new ConcatFieldsMeta();
meta.setTargetFieldName( "concat" );
Defensive patterns

Strategy: validation

Validate before calling

if ( meta.getTargetFieldName() == null || meta.getTargetFieldName().isEmpty() ) {
  throw new IllegalStateException( "ConcatFieldsMeta requires a target field name" );
}

Try / catch

try {
  meta.getFields( row, name, null, null, null, null, metaStore );
} catch ( KettleStepException e ) {
  logError( "Target field name missing: " + e.getMessage() );
}

Prevention

When it happens

Trigger: getFields is called (e.g., during transformation preview, validation, or processRow initialization) while meta.targetFieldName is null or the empty string.

Common situations: New Concat Fields step left unconfigured; programmatic meta construction in tests forgot setTargetFieldName; transformation XML lost the target-field attribute.

Understand the failure class

Background: "must not be empty", "cannot be empty" — required-field validation errors across open-source libraries — this error's family across 41 libraries.

Related errors


AI-assisted analysis of pentaho/pentaho-kettle@f3058517a1 (2026-09-13). Data as JSON: /api/errors/64e7cfeb0d0cf764. Report an issue: GitHub.

Appendix: source

Thrown at plugins/core/impl/src/main/java/org/pentaho/di/trans/steps/concatfields/ConcatFieldsMeta.java:155

    // remove selected fields from the stream when true
    if ( removeSelectedFields ) {
      if ( getOutputFields().length > 0 ) {
        for ( int i = 0; i < getOutputFields().length; i++ ) {
          TextFileField field = getOutputFields()[ i ];
          try {
            row.removeValueMeta( field.getName() );
          } catch ( KettleValueException e ) {
            // just ignore exceptions since missing fields are handled in the ConcatFields class
          }
        }
      } else { // no output fields selected, take them all, remove them all
        row.clear();
      }
    }

    // Check Target Field Name
    if ( Utils.isEmpty( targetFieldName ) ) {
      throw new KettleStepException( BaseMessages.getString(
        PKG, "ConcatFieldsMeta.CheckResult.TargetFieldNameMissing" ) );
    }
    // add targetFieldName
    ValueMetaInterface vValue = new ValueMetaString( targetFieldName );
    vValue.setLength( targetFieldLength, 0 );
    vValue.setOrigin( name );
    if ( !Utils.isEmpty( getEncoding() ) ) {
      vValue.setStringEncoding( getEncoding() );
    }
    row.addValueMeta( vValue );
  }

  @Override
  public void loadXML( Node stepnode, List<DatabaseMeta> databases, IMetaStore metaStore ) throws KettleXMLException {
    super.loadXML( stepnode, databases, metaStore );
    targetFieldName = XMLHandler.getTagValue( stepnode, ConcatFieldsNodeNameSpace, "targetFieldName" );
    targetFieldLength =
      Const.toInt( XMLHandler.getTagValue( stepnode, ConcatFieldsNodeNameSpace, "targetFieldLength" ), 0 );

View on GitHub (pinned to f3058517a1)