pentaho/pentaho-kettle · error · KettleException
Error parsing field #
Error message
Error parsing field #
What it means
In XBase.getRow(), for integer-typed DBF fields (FIELD_TYPE_I), the raw object is converted to a Double. A NumberFormatException during conversion is wrapped as 'Error parsing field #N : <fieldName>'. It indicates stored numeric data in that column cannot be represented as a number.
Solutions
- Inspect the reported field # and name in the offending record; open the DBF in a viewer to find bad values.
- Recover/re-export the DBF from its original source; repair with a DBF fix-up tool if rows are corrupted.
- Verify the DBF codepage/charset matches the data (e.g. 0x03 vs 0x65 language driver byte).
- If bad data must be tolerated, clean the column (blank invalid values) before PDI processing.
Example fix
// before: DBF stores '12a4' in an INTEGER column -> NumberFormatException // after: repair data so column holds '124' or blank
Defensive patterns
Strategy: validation
Validate before calling
// Pre-scan: read rows via XBase.getRow(fields) in a try loop and log
// any field index that throws before running the full transformation
for (int i = 0; i < 10; i++) {
try { xbase.getRow(fields); } catch (KettleException e) { /* flag bad column */ }
} Try / catch
try {
Object[] row = xbase.getRow(fields);
} catch (KettleException e) {
if (e.getMessage().startsWith("Error parsing field #")) {
// clean/repair the named column's data and retry
}
} Prevention
- Sanity-check exported DBF data with a viewer before ETL runs.
- Match DBF codepage to the data's character encoding.
- Restore from a clean source when records look corrupted.
- Blank invalid numeric values at the exporting system, not downstream.
When it happens
Trigger: Calling getRow() on a record whose FIELD_TYPE_I column value (rowobj[i]) fails Integer-to-double conversion and triggers NumberFormatException — typically corrupt or non-numeric bytes in the column.
Common situations: Corrupted DBF rows after an abnormal writer exit; data written by a tool that stored text in a numeric column; encoding/codepage mismatch making digit bytes unreadable; truncated record area.
Understand the failure class
Background: "Invalid ... format", "must be in format X", "does not look like a ..." — invalid argument format errors across CLI tools and libraries — this error's family across 17 libraries.
Related errors
- Error opening DBF metadata
- Error reading DBF file
- Error reading DBF metadata (in part
- Function MOD only works with numeric data
- GPLoad.Exception.MaxErrorsInvalid
AI-assisted analysis of pentaho/pentaho-kettle@f3058517a1 (2026-09-13).
Data as JSON: /api/errors/c2341641a87ffa10.
Report an issue: GitHub.
Appendix: source
Thrown at engine/src/main/java/org/pentaho/di/trans/steps/xbaseinput/XBase.java:185
// Set the values in the row...
//
for ( int i = 0; i < reader.getFieldCount(); i++ ) {
switch ( datatype[i] ) {
case DBFField.FIELD_TYPE_M: // Memo
if ( rowobj[i] != null ) {
r[i] = rowobj[i];
}
break;
case DBFField.FIELD_TYPE_C: // Character
r[i] = Const.rtrim( (String) rowobj[i] );
break;
case FIELD_TYPE_I: // Numeric
try {
if ( rowobj[i] != null ) {
r[i] = ( (Integer) rowobj[i] ).doubleValue();
}
} catch ( NumberFormatException e ) {
throw new KettleException( "Error parsing field #"
+ ( i + 1 ) + " : " + reader.getField( i ).getName(), e );
}
break;
case DBFField.FIELD_TYPE_N: // Numeric
// Convert to Double!!
try {
if ( rowobj[i] != null ) {
r[i] = rowobj[i];
}
} catch ( NumberFormatException e ) {
throw new KettleException( "Error parsing field #"
+ ( i + 1 ) + " : " + reader.getField( i ).getName(), e );
}
break;
case DBFField.FIELD_TYPE_F: // Float
// Convert to double!!
try {
if ( rowobj[i] != null ) {View on GitHub (pinned to f3058517a1)