pentaho/pentaho-kettle · error · KettleException

EditRowsDialog.Error.ErrorGettingRowForData

Error message

EditRowsDialog.Error.ErrorGettingRowForData

What it means

EditRowsDialog.getRowForData converts the grid's displayed string values back into Kettle row data using ValueMeta.convertDataFromString. If any conversion throws a KettleException (e.g. a non-numeric string in a number column, bad date format), it is rethrown as a KettleException 'EditRowsDialog.Error.ErrorGettingRowForData' with the row number.

Solutions

  1. Correct the offending cell so its value matches the column type/format shown in the message's row number.
  2. Enter null (empty) instead of an invalid literal if the field is optional.
  3. Adjust the value meta format string to accept the input format being typed (e.g. set the date format mask).
  4. Catch the KettleException where row/executesAndAssertResults is called and show the message with the rowNr to guide the user.

Example fix

// before
row[i] = valueMeta.convertDataFromString( string, stringValueMeta, null, null, ValueMetaInterface.TRIM_TYPE_NONE );
// after
if ( string == null || string.trim().isEmpty() ) {
  row[i] = null;
} else {
  row[i] = valueMeta.convertDataFromString( string, stringValueMeta, null, null, ValueMetaInterface.TRIM_TYPE_NONE );
}
Defensive patterns

Strategy: validation

Validate before calling

// validate cell text against the column type before committing
if ( valueMeta.isNumeric() && !string.matches( "-?\\d+(\\.\\d+)?" ) ) {
  throw new IllegalArgumentException( "Value '" + string + "' invalid for " + valueMeta.getTypeDesc() );
}

Type guard

// ensure string is convertible before convertDataFromString
boolean convertible;
try {
  valueMeta.convertDataFromString( string, stringValueMeta, null, null, ValueMetaInterface.TRIM_TYPE_NONE );
  convertible = true;
} catch ( KettleException e ) {
  convertible = false;
}

Try / catch

try {
  Object[] row = getRowForData( item, rowNr );
} catch ( KettleException e ) {
  showMessage( BaseMessages.getString( PKG, "EditRowsDialog.Error.ErrorGettingRowForData", Integer.toString( rowNr ) ) + " : " + e.getCause() );
}

Prevention

When it happens

Trigger: Editing rows in the EditRowsDialog grid and entering values that cannot be converted to the column's ValueMeta type (letters in an Integer column, malformed dates), then triggering re-read of the row (scrolling, OK, validation).

Common situations: Hand-editing preview/serialized row grids and typing values that violate the declared data type or format mask; locale-dependent date/number formats not matching the value meta's format.

Understand the failure class

Background: Type mismatch errors: IllegalArgumentException, TypeError and type guards across 150 open-source libraries — this error's family across 150 libraries.

Related errors


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

Appendix: source

Thrown at ui/src/main/java/org/pentaho/di/ui/core/dialog/EditRowsDialog.java:342

      for ( int i = 0; i < rowMeta.size(); i++ ) {
        ValueMetaInterface valueMeta = rowMeta.getValueMeta( i );
        ValueMetaInterface stringValueMeta = stringRowMeta.getValueMeta( i );

        int colnr = i + 1;
        if ( isDisplayingNullValue( item, colnr ) ) {
          row[i] = null; // <null> value
        } else {
          String string = item.getText( colnr );
          if ( stringValueMeta.isNull( string ) ) {
            string = null;
          }
          row[i] = valueMeta.convertDataFromString( string, stringValueMeta,
            null, null, ValueMetaInterface.TRIM_TYPE_NONE );
        }
      }
      return row;
    } catch ( KettleException e ) {
      throw new KettleException( BaseMessages.getString( PKG, "EditRowsDialog.Error.ErrorGettingRowForData",
        Integer.toString( rowNr ) ), e );
    }
  }

  @VisibleForTesting
  boolean isDisplayingNullValue( TableItem item, int column ) throws KettleException {
    return GUIResource.getInstance().getColorBlue().equals( item.getForeground( column ) );
  }

  private void ok() {

    try {
      stringRowMeta = new RowMeta();
      for ( ValueMetaInterface valueMeta : rowMeta.getValueMetaList() ) {
        ValueMetaInterface stringValueMeta = ValueMetaFactory.cloneValueMeta( valueMeta,
          ValueMetaInterface.TYPE_STRING );
        stringRowMeta.addValueMeta( stringValueMeta );
      }

View on GitHub (pinned to f3058517a1)