pentaho/pentaho-kettle · error · KettleException

ExcelInput.Exception.InvalidTypeDate

ExcelInput.Exception.InvalidTypeDate

Error message

ExcelInput.Exception.InvalidTypeDate

What it means

ExcelInput.checkType() throws this KettleException when an Excel cell contains a DATE but the field's ValueMeta target type is not String, None, or Date. The step refuses to convert a date cell into an incompatible declared type.

Solutions

  1. Change the field's Type to Date (with the proper Format) or String in the Excel Input step dialog
  2. If a numeric representation is required, read as Date then use 'Calculator'/'Formula' to convert downstream
  3. Check the Excel sheet formatting: format the column as text/number if dates were unintended
  4. Use Preview rows to verify the detected cell type before running

Example fix

// before
field: columnName=orderDate, type=Number
// after
field: columnName=orderDate, type=Date, format=yyyy-MM-dd
Defensive patterns

Strategy: validation

Validate before calling

int cellType = cell.getType();
int fieldType = v.getType();
boolean ok = cellType == KCellType.DATE
  && ( fieldType == ValueMetaInterface.TYPE_STRING
    || fieldType == ValueMetaInterface.TYPE_NONE
    || fieldType == ValueMetaInterface.TYPE_DATE );
if ( !ok ) { /* set field type to Date or String in step metadata */ }

Type guard

boolean acceptsDateCell( ValueMetaInterface v ) {
  int t = v.getType();
  return t == ValueMetaInterface.TYPE_STRING
    || t == ValueMetaInterface.TYPE_NONE
    || t == ValueMetaInterface.TYPE_DATE;
}

Try / catch

try {
  row = excelInput.fillRow( cells, ... );
} catch ( KettleException e ) {
  if ( e.getMessage().contains( "InvalidTypeDate" ) ) {
    // change the field type to Date (with a format mask) and rerun
  }
}

Prevention

When it happens

Trigger: fillRow() encounters a date-typed cell while the mapped field is declared as Integer, Number, Boolean, or BigNumber in the Excel Input step metadata.

Common situations: Excel auto-detected real dates in a column the developer typed as Number, or the sheet was reformatted to date cells after the step fields were configured.

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/2589bb1c270be335. Report an issue: GitHub.

Appendix: source

Thrown at plugins/excel/core/src/main/java/org/pentaho/di/trans/steps/excelinput/ExcelInput.java:332

  }

  private void checkType( KCell cell, ValueMetaInterface v ) throws KettleException {
    if ( !meta.isStrictTypes() ) {
      return;
    }
    switch ( cell.getType() ) {
      case BOOLEAN:
        if ( !( v.getType() == ValueMetaInterface.TYPE_STRING || v.getType() == ValueMetaInterface.TYPE_NONE || v
          .getType() == ValueMetaInterface.TYPE_BOOLEAN ) ) {
          throw new KettleException( BaseMessages.getString( PKG, "ExcelInput.Exception.InvalidTypeBoolean", v
            .getTypeDesc() ) );
        }
        break;

      case DATE:
        if ( !( v.getType() == ValueMetaInterface.TYPE_STRING || v.getType() == ValueMetaInterface.TYPE_NONE || v
          .getType() == ValueMetaInterface.TYPE_DATE ) ) {
          throw new KettleException( BaseMessages.getString( PKG, "ExcelInput.Exception.InvalidTypeDate", cell
            .getContents(), v.getTypeDesc() ) );
        }
        break;

      case LABEL:
        if ( v.getType() == ValueMetaInterface.TYPE_BOOLEAN
          || v.getType() == ValueMetaInterface.TYPE_DATE || v.getType() == ValueMetaInterface.TYPE_INTEGER
          || v.getType() == ValueMetaInterface.TYPE_NUMBER ) {
          throw new KettleException( BaseMessages.getString( PKG, "ExcelInput.Exception.InvalidTypeLabel", cell
            .getContents(), v.getTypeDesc() ) );
        }
        break;

      case EMPTY:
        // OK
        break;

      case NUMBER:

View on GitHub (pinned to f3058517a1)