{"record":{"id":"600d56905e5125b5","repo":"pentaho/pentaho-kettle","slug":"excelinput-exception-invalidtypenumber","errorCode":"ExcelInput.Exception.InvalidTypeNumber","errorMessage":"ExcelInput.Exception.InvalidTypeNumber","messagePattern":"ExcelInput\\.Exception\\.InvalidTypeNumber","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"plugins/excel/core/src/main/java/org/pentaho/di/trans/steps/excelinput/ExcelInput.java","lineNumber":354,"sourceCode":"\n      case LABEL:\n        if ( v.getType() == ValueMetaInterface.TYPE_BOOLEAN\n          || v.getType() == ValueMetaInterface.TYPE_DATE || v.getType() == ValueMetaInterface.TYPE_INTEGER\n          || v.getType() == ValueMetaInterface.TYPE_NUMBER ) {\n          throw new KettleException( BaseMessages.getString( PKG, \"ExcelInput.Exception.InvalidTypeLabel\", cell\n            .getContents(), v.getTypeDesc() ) );\n        }\n        break;\n\n      case EMPTY:\n        // OK\n        break;\n\n      case NUMBER:\n        if ( !( v.getType() == ValueMetaInterface.TYPE_STRING\n          || v.getType() == ValueMetaInterface.TYPE_NONE || v.getType() == ValueMetaInterface.TYPE_INTEGER\n          || v.getType() == ValueMetaInterface.TYPE_BIGNUMBER || v.getType() == ValueMetaInterface.TYPE_NUMBER ) ) {\n          throw new KettleException( BaseMessages.getString( PKG, \"ExcelInput.Exception.InvalidTypeNumber\", cell\n            .getContents(), v.getTypeDesc() ) );\n        }\n        break;\n\n      default:\n        throw new KettleException( BaseMessages.getString( PKG, \"ExcelInput.Exception.UnsupportedType\", cell\n          .getType().getDescription(), cell.getContents() ) );\n    }\n  }\n\n  public boolean processRow( StepMetaInterface smi, StepDataInterface sdi ) throws KettleException {\n    meta = (ExcelInputMeta) smi;\n    data = (ExcelInputData) sdi;\n\n    if ( first ) {\n      first = false;\n\n      data.outputRowMeta = new RowMeta(); // start from scratch!","sourceCodeStart":336,"sourceCodeEnd":372,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/excel/core/src/main/java/org/pentaho/di/trans/steps/excelinput/ExcelInput.java#L336-L372","documentation":"ExcelInput.checkType() throws this KettleException when an Excel cell contains a NUMBER but the field's declared target type is not String, None, Integer, BigNumber, or Number. A numeric cell cannot be fed to Boolean, Date, or other incompatible types.","triggerScenarios":"fillRow() encounters a numeric cell while the mapped field is declared as Boolean, Date, or another non-numeric-accepting type in the Excel Input step metadata.","commonSituations":"A column that previously contained dates/text now contains numeric serial numbers or values, while the field is still typed as Date or Boolean.","solutions":["Change the field's Type to Number, Integer, BigNumber, or String in the Excel Input step dialog","If a Date is expected, fix the sheet cell formatting to a real date (Excel stores dates as numbers) and keep the field type as Date","Read as Number and convert downstream (Calculator / Select values) if a different type is required","Preview rows to confirm detected cell types before executing the transformation"],"exampleFix":"// before\nfield: columnName=created, type=Date  // Excel cell is a raw number\n// after\nfield: columnName=created, type=Number  // then convert serial to date downstream\n// or fix the Excel column format to a Date type","handlingStrategy":"validation","validationCode":"int cellType = cell.getType();\nint fieldType = v.getType();\nboolean ok = cellType == KCellType.NUMBER\n  && ( fieldType == ValueMetaInterface.TYPE_STRING\n    || fieldType == ValueMetaInterface.TYPE_NONE\n    || fieldType == ValueMetaInterface.TYPE_INTEGER\n    || fieldType == ValueMetaInterface.TYPE_BIGNUMBER\n    || fieldType == ValueMetaInterface.TYPE_NUMBER );\nif ( !ok ) { /* fix field type or sheet cell formatting */ }","typeGuard":"boolean acceptsNumberCell( ValueMetaInterface v ) {\n  int t = v.getType();\n  return t == ValueMetaInterface.TYPE_STRING\n    || t == ValueMetaInterface.TYPE_NONE\n    || t == ValueMetaInterface.TYPE_INTEGER\n    || t == ValueMetaInterface.TYPE_BIGNUMBER\n    || t == ValueMetaInterface.TYPE_NUMBER;\n}","tryCatchPattern":"try {\n  row = excelInput.fillRow( cells, ... );\n} catch ( KettleException e ) {\n  if ( e.getMessage().contains( \"InvalidTypeNumber\" ) ) {\n    // change the field to Number/String or fix the sheet to emit real dates\n  }\n}","preventionTips":["Remember Excel stores dates as numeric serials — set field types accordingly","Keep numeric columns typed as Number/Integer/BigNumber in step metadata","Preview rows to detect cell type drift after sheet edits"],"tags":["pdi","excel-input","type-mismatch","data-types"],"backgroundTag":"type-mismatch","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"}