apache/iceberg · error · UnsupportedOperationException
Unsupported type
Error message
Unsupported type: ${type.typeId()} What it means
convertValue dispatches on the Iceberg Type's typeId to a specific conversion method (convertInt, convertString, etc.). If the field's Iceberg type has no case in the switch, it throws UnsupportedOperationException with the typeId. This guards against Iceberg types the connector does not support converting from Connect values.
Solutions
- Upgrade org.apache.iceberg:iceberg-kafka-connect to a version whose RecordConverter handles the type.
- Extend RecordConverter (it is extensible via protected methods) and override convertValue or add handling for the unsupported typeId.
- Exclude/alter the offending column in the table schema so its typeId is one of the supported ones.
Example fix
// before // outdated converter fails on typeId VARIANT // after // upgrade dependency: // implementation 'org.apache.iceberg:iceberg-kafka-connect:1.10.0' // adds VARIANT support
Defensive patterns
Strategy: validation
Validate before calling
Schema tableSchema = table.schema();
tableSchema.columns().forEach(f -> {
if (!SUPPORTED_TYPE_IDS.contains(f.type().typeId())) {
throw new IllegalStateException("Unsupported column type: " + f.name() + " -> " + f.type());
}
}); Try / catch
try {
Record r = converter.convert(value, consumer);
} catch (UnsupportedOperationException e) {
if (e.getMessage() != null && e.getMessage().startsWith("Unsupported type:")) {
upgradeConverterOrSkipField(e);
} else throw e;
} Prevention
- Keep the iceberg-kafka-connect dependency in lockstep with the Iceberg core version used to create tables.
- Review table schema evolution for newly introduced types before consumers ingest them.
- Pin tested Iceberg versions in your connector distribution.
When it happens
Trigger: An Iceberg field whose type's typeId falls through the switch — e.g. nested/unknown type IDs not handled by the installed converter, or subclassed Type instances added in newer Iceberg versions.
Common situations: Running an older kafka-connect build against tables using newer Iceberg types (e.g. variant/geospatial extensions); a schema evolved in the table but the sink bundle is outdated.
Related errors
- Cannot convert Number to variant (unknown type)
- Cannot convert to variant
- Cannot extract value from type
- ID column not found
- Unhandled type
AI-assisted analysis of apache/iceberg@86d9c8fc54 (2026-09-12).
Data as JSON: /api/errors/69f1816be6e90583.
Report an issue: GitHub.
Appendix: source
Thrown at kafka-connect/kafka-connect/src/main/java/org/apache/iceberg/connect/data/RecordConverter.java:167
return convertBoolean(value);
case STRING:
return convertString(value);
case UUID:
return convertUUID(value);
case BINARY:
return convertBase64Binary(value);
case FIXED:
return ByteBuffers.toByteArray(convertBase64Binary(value));
case DATE:
return convertDateValue(value);
case TIME:
return convertTimeValue(value);
case TIMESTAMP:
return convertTimestampValue(value, (TimestampType) type);
case VARIANT:
return convertVariantValue(value);
}
throw new UnsupportedOperationException("Unsupported type: " + type.typeId());
}
protected GenericRecord convertStructValue(
Object value,
StructType schema,
int parentFieldId,
SchemaUpdate.Consumer schemaUpdateConsumer) {
if (value instanceof Map) {
return convertToStruct((Map<?, ?>) value, schema, parentFieldId, schemaUpdateConsumer);
} else if (value instanceof Struct) {
return convertToStruct((Struct) value, schema, parentFieldId, schemaUpdateConsumer);
}
throw new IllegalArgumentException("Cannot convert to struct: " + value.getClass().getName());
}
/**
* This method will be called for records when there is no record schema. Also, when there is no
* schema, we infer that map values are struct types. This method might also be called if theView on GitHub (pinned to 86d9c8fc54)