{"record":{"id":"058f014538c18e96","repo":"pentaho/pentaho-kettle","slug":"kafkaconsumerfield-type-error-novaluemetainterfacemapping","errorCode":"KafkaConsumerField.Type.ERROR.NoValueMetaInterfaceMapping","errorMessage":"KafkaConsumerField.Type.ERROR.NoValueMetaInterfaceMapping","messagePattern":"KafkaConsumerField\\.Type\\.ERROR\\.NoValueMetaInterfaceMapping","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"plugins/kafka/core/src/main/java/org/pentaho/big/data/kettle/plugins/kafka/KafkaConsumerField.java","lineNumber":127,"sourceCode":"      return valueMetaInterfaceType;\n    }\n\n    public Class getKafkaSerializerClass() {\n      return kafkaSerializerClass;\n    }\n\n    public Class getKafkaDeserializerClass() {\n      return kafkaDeserializerClass;\n    }\n\n    public static Type fromValueMetaInterface( ValueMetaInterface vmi ) {\n      if ( vmi != null ) {\n        for ( Type t : Type.values() ) {\n          if ( vmi.getType() == t.getValueMetaInterfaceType() ) {\n            return t;\n          }\n        }\n        throw new IllegalArgumentException( BaseMessages.getString( PKG,\n          \"KafkaConsumerField.Type.ERROR.NoValueMetaInterfaceMapping\", vmi.getName(), vmi.getType() ) );\n      }\n      // if it's null, just default to string\n      return String;\n    }\n  }\n\n  public enum Name {\n    KEY( \"key\" ) {\n      @Override public void setFieldOnMeta( KafkaConsumerInputMeta meta, KafkaConsumerField field ) {\n        meta.setKeyField( field );\n      }\n\n      @Override public KafkaConsumerField getFieldFromMeta( KafkaConsumerInputMeta meta ) {\n        return meta.getKeyField();\n      }\n    },\n    MESSAGE( \"message\" ) {","sourceCodeStart":109,"sourceCodeEnd":145,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/kafka/core/src/main/java/org/pentaho/big/data/kettle/plugins/kafka/KafkaConsumerField.java#L109-L145","documentation":"KafkaConsumerField.fromValueMetaInterface maps a ValueMetaInterface type code to the plugin's Type enum; if the incoming ValueMetaInterface's type has no corresponding enum constant, it throws IllegalArgumentException with KafkaConsumerField.Type.ERROR.NoValueMetaInterfaceMapping including the field name and numeric type. This surfaces when the Kafka consumer field definition carries a Kettle type the plugin doesn't support.","triggerScenarios":"fromValueMetaInterface is given a non-null ValueMetaInterface whose getType() integer matches no Type.getValueMetaInterfaceType() in the enum — e.g. a binary/serialization type added by another plugin or an unusual type assigned upstream in the transformation.","commonSituations":"Upstream step emits an exotic ValueMeta type (e.g. Avro/serializable) that the Kafka consumer field can't represent; transformation edited across plugin versions where enum coverage changed; misconfigured field output type in the Kafka Consumer dialog.","solutions":["Change the upstream field to a supported type (String, Integer, Long, Double, BigDecimal, Date, Boolean, Timestamp, Binary) with a 'Select values' / 'Change data type' step.","Update the Kafka Consumer step's field Output Type to a supported enum value.","Check plugin versions; upgrade the Kafka plugin/PDI if a newer version added the mapping you need.","Convert unsupported types to String before feeding the Kafka Consumer step."],"exampleFix":"// before (Select values step leaves field as Serializable)\nmetaType: Serializable\n// after\nmetaType: String","handlingStrategy":"validation","validationCode":"// Before writing to Kafka, normalize field types upstream (Select values step)\n// or in UDJC:\nValueMetaInterface vmi = rowMeta.searchValueMeta(fieldName);\nSet<Integer> supported = Set.of(\n  ValueMetaInterface.TYPE_STRING, ValueMetaInterface.TYPE_INTEGER,\n  ValueMetaInterface.TYPE_NUMBER, ValueMetaInterface.TYPE_BIGNUMBER,\n  ValueMetaInterface.TYPE_DATE, ValueMetaInterface.TYPE_BOOLEAN,\n  ValueMetaInterface.TYPE_TIMESTAMP, ValueMetaInterface.TYPE_BINARY);\nif (!supported.contains(vmi.getType())) {\n  throw new IllegalStateException(\"Unsupported Kafka field type: \" + vmi.getType() + \" for \" + fieldName);\n}","typeGuard":null,"tryCatchPattern":"try { consumerField = KafkaConsumerField.fromValueMetaInterface(vmi); } catch (IllegalArgumentException e) {\n  log.warn(\"No mapping for type \" + vmi.getType() + \"; defaulting to String\");\n  consumerField = KafkaConsumerField.Type.String;\n}","preventionTips":["Coerce fields to basic types before the Kafka Consumer/producer step.","Keep the Kafka plugin and PDI core on matching versions.","Document the supported Output Type list for transformation authors."],"tags":["kafka","pdi","enum","type-mapping","value-meta"],"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"}