{"record":{"id":"85b17d90e954b6ba","repo":"pentaho/pentaho-kettle","slug":"unable-to-serialize-index-storage-type-to-xml-for-data-type","errorCode":null,"errorMessage":" : Unable to serialize index storage type to XML for data type ","messagePattern":" : Unable to serialize index storage type to XML for data type ","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"core/src/main/java/org/pentaho/di/core/row/value/ValueMetaBase.java","lineNumber":3277,"sourceCode":"                  xml.append( XMLHandler.addTagValue( \"value\", (Double) index[i] ) );\n                  break;\n                case TYPE_INTEGER:\n                  xml.append( XMLHandler.addTagValue( \"value\", (Long) index[i] ) );\n                  break;\n                case TYPE_DATE:\n                  xml.append( XMLHandler.addTagValue( \"value\", (Date) index[i] ) );\n                  break;\n                case TYPE_BIGNUMBER:\n                  xml.append( XMLHandler.addTagValue( \"value\", (BigDecimal) index[i] ) );\n                  break;\n                case TYPE_BOOLEAN:\n                  xml.append( XMLHandler.addTagValue( \"value\", (Boolean) index[i] ) );\n                  break;\n                case TYPE_BINARY:\n                  xml.append( XMLHandler.addTagValue( \"value\", (byte[]) index[i] ) );\n                  break;\n                default:\n                  throw new IOException( toString() + \" : Unable to serialize index storage type to XML for data type \"\n                      + getType() );\n              }\n            } catch ( ClassCastException e ) {\n              throw new RuntimeException( toString() + \" : There was a data type error: the data type of \"\n                  + index[i].getClass().getName() + \" object [\" + index[i] + \"] does not correspond to value meta [\"\n                  + toStringMeta() + \"]\" );\n            }\n          }\n        }\n        xml.append( XMLHandler.closeTag( \"index\" ) );\n        break;\n\n      case STORAGE_TYPE_BINARY_STRING:\n        // Save the storage meta data...\n        //\n        if ( storageMetadata != null ) {\n          xml.append( XMLHandler.openTag( \"storage-meta\" ) );\n          xml.append( storageMetadata.getMetaXML() );","sourceCodeStart":3259,"sourceCodeEnd":3295,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/core/src/main/java/org/pentaho/di/core/row/value/ValueMetaBase.java#L3259-L3295","documentation":"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.","triggerScenarios":"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).","commonSituations":"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.","solutions":["Use a supported data type (String, Number, Integer, Date, BigNumber, Boolean, Binary) for indexed-storage values.","Upgrade both the designer and the runtime to matching Pentaho versions that support the newer types in indexed XML serialization.","Convert the field: e.g. map a Timestamp index to Date or a formatted String before setting STORAGE_TYPE_INDEXED.","If a plugin introduced a custom type, serialize it via a supported type or add custom XML handling."],"exampleFix":"// before\nValueMetaBase vm = new ValueMetaBase(\"lookup\", ValueMetaInterface.TYPE_INET);\nvm.setStorageType(ValueMetaInterface.STORAGE_TYPE_INDEXED);\n// after\nValueMetaBase vm = new ValueMetaBase(\"lookup\", ValueMetaInterface.TYPE_STRING);\nvm.setStorageType(ValueMetaInterface.STORAGE_TYPE_INDEXED);","handlingStrategy":"validation","validationCode":"int[] ok = { TYPE_STRING, TYPE_NUMBER, TYPE_INTEGER, TYPE_DATE, TYPE_BIGNUMBER, TYPE_BOOLEAN, TYPE_BINARY };\nif (vm.getStorageType() == STORAGE_TYPE_INDEXED\n    && Arrays.stream(ok).noneMatch(t -> t == vm.getType())) {\n  vm.setStorageType(STORAGE_TYPE_NORMAL); // or convert the field type\n}","typeGuard":"boolean canSerializeIndexedToXml(ValueMetaInterface vm) {\n  switch (vm.getType()) {\n    case ValueMetaInterface.TYPE_STRING:\n    case ValueMetaInterface.TYPE_NUMBER:\n    case ValueMetaInterface.TYPE_INTEGER:\n    case ValueMetaInterface.TYPE_DATE:\n    case ValueMetaInterface.TYPE_BIGNUMBER:\n    case ValueMetaInterface.TYPE_BOOLEAN:\n    case ValueMetaInterface.TYPE_BINARY:\n      return vm.getStorageType() == ValueMetaInterface.STORAGE_TYPE_INDEXED;\n    default:\n      return false;\n  }\n}","tryCatchPattern":"try {\n  String xml = rowMeta.getMetaXML();\n} catch (IOException e) {\n  if (e.getMessage().contains(\"Unable to serialize index storage type\")) {\n    logError(\"Field with unsupported indexed type: \" + e.getMessage());\n  }\n  throw e;\n}","preventionTips":["Audit transformations for indexed-storage fields with Timestamp/Inet/Json types.","Prefer STORAGE_TYPE_NORMAL unless indexed lookup is genuinely needed.","Align Kettle versions before importing transformations between environments."],"tags":["xml","serialization","indexed-storage","unsupported-type"],"backgroundTag":"unsupported-enum-value","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"}