pentaho/pentaho-kettle · error · IOException

: Unable to serialize index storage type to XML for data…

Error message

 : Unable to serialize index storage type to XML for data type 

What it means

In ValueMetaBase.getXML, when the value uses indexed storage each index entry is converted to XML according to the value's data type. If the data type is not one of the supported indexed types (String, Number, Integer, Date, BigNumber, Boolean, Binary), an IOException is thrown with this message. It means the indexed storage type cannot be represented in the XML metadata format.

Solutions

  1. Use a supported data type (String, Number, Integer, Date, BigNumber, Boolean, Binary) for indexed-storage values.
  2. Upgrade both the designer and the runtime to matching Pentaho versions that support the newer types in indexed XML serialization.
  3. Convert the field: e.g. map a Timestamp index to Date or a formatted String before setting STORAGE_TYPE_INDEXED.
  4. If a plugin introduced a custom type, serialize it via a supported type or add custom XML handling.

Example fix

// before
ValueMetaBase vm = new ValueMetaBase("lookup", ValueMetaInterface.TYPE_INET);
vm.setStorageType(ValueMetaInterface.STORAGE_TYPE_INDEXED);
// after
ValueMetaBase vm = new ValueMetaBase("lookup", ValueMetaInterface.TYPE_STRING);
vm.setStorageType(ValueMetaInterface.STORAGE_TYPE_INDEXED);
Defensive patterns

Strategy: validation

Validate before calling

int[] ok = { TYPE_STRING, TYPE_NUMBER, TYPE_INTEGER, TYPE_DATE, TYPE_BIGNUMBER, TYPE_BOOLEAN, TYPE_BINARY };
if (vm.getStorageType() == STORAGE_TYPE_INDEXED
    && Arrays.stream(ok).noneMatch(t -> t == vm.getType())) {
  vm.setStorageType(STORAGE_TYPE_NORMAL); // or convert the field type
}

Type guard

boolean canSerializeIndexedToXml(ValueMetaInterface vm) {
  switch (vm.getType()) {
    case ValueMetaInterface.TYPE_STRING:
    case ValueMetaInterface.TYPE_NUMBER:
    case ValueMetaInterface.TYPE_INTEGER:
    case ValueMetaInterface.TYPE_DATE:
    case ValueMetaInterface.TYPE_BIGNUMBER:
    case ValueMetaInterface.TYPE_BOOLEAN:
    case ValueMetaInterface.TYPE_BINARY:
      return vm.getStorageType() == ValueMetaInterface.STORAGE_TYPE_INDEXED;
    default:
      return false;
  }
}

Try / catch

try {
  String xml = rowMeta.getMetaXML();
} catch (IOException e) {
  if (e.getMessage().contains("Unable to serialize index storage type")) {
    logError("Field with unsupported indexed type: " + e.getMessage());
  }
  throw e;
}

Prevention

When it happens

Trigger: Calling getMetaXML()/getXML() on a value meta with STORAGE_TYPE_INDEXED whose data type falls into the switch's default branch (e.g. TYPE_TIMESTAMP, TYPE_INET, TYPE_JSON, TYPE_AVRO).

Common situations: Exporting a transformation containing an indexed value of a newer type (Timestamp/Inet) with an older Kettle version; programmatically building indexed value metas with exotic types; plugins defining custom value types used with indexed storage.

Related errors


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

Appendix: source

Thrown at core/src/main/java/org/pentaho/di/core/row/value/ValueMetaBase.java:3277

                  xml.append( XMLHandler.addTagValue( "value", (Double) index[i] ) );
                  break;
                case TYPE_INTEGER:
                  xml.append( XMLHandler.addTagValue( "value", (Long) index[i] ) );
                  break;
                case TYPE_DATE:
                  xml.append( XMLHandler.addTagValue( "value", (Date) index[i] ) );
                  break;
                case TYPE_BIGNUMBER:
                  xml.append( XMLHandler.addTagValue( "value", (BigDecimal) index[i] ) );
                  break;
                case TYPE_BOOLEAN:
                  xml.append( XMLHandler.addTagValue( "value", (Boolean) index[i] ) );
                  break;
                case TYPE_BINARY:
                  xml.append( XMLHandler.addTagValue( "value", (byte[]) index[i] ) );
                  break;
                default:
                  throw new IOException( toString() + " : Unable to serialize index storage type to XML for data type "
                      + getType() );
              }
            } catch ( ClassCastException e ) {
              throw new RuntimeException( toString() + " : There was a data type error: the data type of "
                  + index[i].getClass().getName() + " object [" + index[i] + "] does not correspond to value meta ["
                  + toStringMeta() + "]" );
            }
          }
        }
        xml.append( XMLHandler.closeTag( "index" ) );
        break;

      case STORAGE_TYPE_BINARY_STRING:
        // Save the storage meta data...
        //
        if ( storageMetadata != null ) {
          xml.append( XMLHandler.openTag( "storage-meta" ) );
          xml.append( storageMetadata.getMetaXML() );

View on GitHub (pinned to f3058517a1)