pentaho/pentaho-kettle · error · KettleException

ExcelInput.Exception.InvalidTypeLabel

ExcelInput.Exception.InvalidTypeLabel

Error message

ExcelInput.Exception.InvalidTypeLabel

What it means

ExcelInput.checkType() throws this KettleException when an Excel cell contains a LABEL (text) but the field's declared type is Boolean, Date, Integer, or Number. Text cells cannot be delivered to those target types without an explicit conversion.

Solutions

  1. Change the field's Type to String in the Excel Input step and convert downstream with 'Select values' (metadata type change) or 'Calculator'
  2. Clean the source sheet so the column contains real numbers/dates instead of text
  3. If the target type is correct, ensure Excel stores the cells as numeric/date, not text (remove apostrophes/quotes)
  4. Check for a header row included in the data range; exclude it from the sheet's rows range

Example fix

// before
field: columnName=amount, type=Number  // cell contains '1234 ' as text
// after
field: columnName=amount, type=String
// then: Select Values step -> amount -> Type=Number, non-strict
Defensive patterns

Strategy: validation

Validate before calling

int cellType = cell.getType();
int fieldType = v.getType();
boolean bad = cellType == KCellType.LABEL
  && ( fieldType == ValueMetaInterface.TYPE_BOOLEAN
    || fieldType == ValueMetaInterface.TYPE_DATE
    || fieldType == ValueMetaInterface.TYPE_INTEGER
    || fieldType == ValueMetaInterface.TYPE_NUMBER );
if ( bad ) { /* read as String and convert downstream */ }

Type guard

boolean acceptsLabelCell( ValueMetaInterface v ) {
  int t = v.getType();
  return t != ValueMetaInterface.TYPE_BOOLEAN
    && t != ValueMetaInterface.TYPE_DATE
    && t != ValueMetaInterface.TYPE_INTEGER
    && t != ValueMetaInterface.TYPE_NUMBER;
}

Try / catch

try {
  row = excelInput.fillRow( cells, ... );
} catch ( KettleException e ) {
  if ( e.getMessage().contains( "InvalidTypeLabel" ) ) {
    // set field type to String; add a Select values/Calculator conversion step
  }
}

Prevention

When it happens

Trigger: fillRow() encounters a label (string) cell while the mapped field is defined as Boolean, Date, Integer, or Number in the step metadata.

Common situations: Columns that previously held numbers now contain text (stray spaces, headers row in data, quoted values), or the field type was changed to Number/Date while Excel treats values as text.

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/3697ee481edc0604. Report an issue: GitHub.

Appendix: source

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

          .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:
        if ( !( v.getType() == ValueMetaInterface.TYPE_STRING
          || v.getType() == ValueMetaInterface.TYPE_NONE || v.getType() == ValueMetaInterface.TYPE_INTEGER
          || v.getType() == ValueMetaInterface.TYPE_BIGNUMBER || v.getType() == ValueMetaInterface.TYPE_NUMBER ) ) {
          throw new KettleException( BaseMessages.getString( PKG, "ExcelInput.Exception.InvalidTypeNumber", cell
            .getContents(), v.getTypeDesc() ) );
        }
        break;

      default:

View on GitHub (pinned to f3058517a1)