pentaho/pentaho-kettle · error · KettleException

TeraFast.Exception.TypeNotSupported

TeraFast.Exception.TypeNotSupported

Error message

TeraFast.Exception.TypeNotSupported

What it means

writeToDataFile serializes each incoming row value into the fastload data file with a switch over ValueMetaInterface types; any value type not explicitly handled (anything beyond String/Number/Date/Integer/Boolean/BigNumber/Binary handled cases) falls into the default branch and throws this KettleException. It means the step does not know how to render that Kettle value type into the flat data file.

Solutions

  1. Use a 'Select values' step before TeraFast to convert unsupported fields (e.g. Timestamp to Date or String) into supported types.
  2. Upgrade the pentaho-hl7/terafast plugin (or Pentaho version) to one whose writeToDataFile switch handles the field's type (e.g. TYPE_TIMESTAMP).
  3. Check the source step's metadata: change the database field mapping or add a Calculator/Text File Output style cast so the field reaches TeraFast as String/Number/Date.
  4. If you own the plugin, add a case for the unsupported ValueMetaInterface.TYPE_* in writeToDataFile and format it explicitly.

Example fix

// before
case ValueMetaInterface.TYPE_BINARY:
  byte[] byt = rowMetaInterface.getBinary( row, i );
  dataFilePrintStream.print( byt );
  break;
default:
  throw new KettleException(...TypeNotSupported...);
// after
case ValueMetaInterface.TYPE_TIMESTAMP:
  dataFilePrintStream.print( valueMeta.getString( row ) ); // render timestamps explicitly
  break;
case ValueMetaInterface.TYPE_BINARY:
  byte[] byt = rowMetaInterface.getBinary( row, i );
  dataFilePrintStream.write( byt ); // also fix: no implicit byt.toString()
  break;
default:
  throw new KettleException(...TypeNotSupported...);
Defensive patterns

Strategy: type-guard

Validate before calling

import org.pentaho.di.compatibility.ValueMetaInterface;
java.util.Set<Integer> supported = new HashSet<>( java.util.Arrays.asList(
  ValueMetaInterface.TYPE_STRING, ValueMetaInterface.TYPE_NUMBER,
  ValueMetaInterface.TYPE_INTEGER, ValueMetaInterface.TYPE_BOOLEAN,
  ValueMetaInterface.TYPE_DATE, ValueMetaInterface.TYPE_BIGNUMBER,
  ValueMetaInterface.TYPE_BINARY ) );
for ( int i = 0; i < rowMeta.size(); i++ ) {
  if ( !supported.contains( rowMeta.getValueMeta( i ).getType() ) ) {
    throw new IllegalArgumentException( "Field '" + rowMeta.getValueMeta( i ).getName()
      + "' has unsupported type for TeraFast: " + rowMeta.getValueMeta( i ).getTypeDesc() );
  }
}

Type guard

boolean isTeraFastCompatible( org.pentaho.di.core.row.ValueMetaInterface vm ) {
  int t = vm.getType();
  return t == ValueMetaInterface.TYPE_STRING || t == ValueMetaInterface.TYPE_NUMBER
    || t == ValueMetaInterface.TYPE_INTEGER || t == ValueMetaInterface.TYPE_BOOLEAN
    || t == ValueMetaInterface.TYPE_DATE || t == ValueMetaInterface.TYPE_BIGNUMBER
    || t == ValueMetaInterface.TYPE_BINARY;
}

Try / catch

try {
  writeToDataFile( rowMeta, row );
} catch ( KettleException e ) {
  if ( e.getMessage().contains( "TypeNotSupported" ) ) {
    throw new KettleException( "Unsupported field type reaching TeraFast; add a 'Select values' step to cast the field (e.g. Timestamp->Date/String) before this step", e );
  }
  throw e;
}

Prevention

When it happens

Trigger: A transformation feeds the TeraFast step a field whose ValueMetaInterface.getType() is not one of the supported TYPE_* constants handled in the switch, e.g. TYPE_TIMESTAMP, TYPE_INET, TYPE_SERIALIZABLE, or a Binary-adjacent type the loaded plugin version predates, causing the default branch to execute on the first row containing that field.

Common situations: Feeding a Timestamp field (common with modern databases) into an older TeraFast plugin built before TYPE_TIMESTAMP handling was added; passing binary/blob or Serializable fields; upstream step producing typed metadata the plugin never supported.

Related errors


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

Appendix: source

Thrown at plugins/terafast-bulk-loader/impl/src/main/java/org/pentaho/di/trans/steps/terafastbulkloader/TeraFast.java:287

          case ValueMetaInterface.TYPE_DATE:
            Date dt = rowMetaInterface.getDate( row, i );
            dataFilePrintStream.print( simpleDateFormat.format( dt ) );
            break;
          case ValueMetaInterface.TYPE_BOOLEAN:
            Boolean b = rowMetaInterface.getBoolean( row, i );
            if ( b.booleanValue() ) {
              dataFilePrintStream.print( "Y" );
            } else {
              dataFilePrintStream.print( "N" );
            }
            break;
          case ValueMetaInterface.TYPE_BINARY:
            byte[] byt = rowMetaInterface.getBinary( row, i );
            // REVIEW - this does an implicit byt.toString, which can't be what was intended.
            dataFilePrintStream.print( byt );
            break;
          default:
            throw new KettleException( BaseMessages.getString(
              PKG, "TeraFast.Exception.TypeNotSupported", valueMeta.getType() ) );
        }
      }
      dataFilePrintStream.print( FastloadControlBuilder.DATAFILE_COLUMN_SEPERATOR );
    }
    dataFilePrintStream.print( Const.CR );
  }

  private String pad( ValueMetaInterface valueMetaInterface, String data ) {
    StringBuilder padding = new StringBuilder( data );
    int padLength = valueMetaInterface.getLength() - data.length();
    int currentPadLength = 0;
    while ( currentPadLength < padLength ) {
      padding.append( " " );
      currentPadLength++;

    }
    return padding.toString();

View on GitHub (pinned to f3058517a1)