{"record":{"id":"30438b4ac8646dc1","repo":"apache/iceberg","slug":"cannot-deserialize-type-type","errorCode":null,"errorMessage":"Cannot deserialize type: + type","messagePattern":"Cannot deserialize type: \\+ type","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"api/src/main/java/org/apache/iceberg/types/Conversions.java","lineNumber":213,"sourceCode":"        return UUIDUtil.convert(tmp);\n      case FIXED:\n      case BINARY:\n        return tmp;\n      case DECIMAL:\n        Types.DecimalType decimal = (Types.DecimalType) type;\n        byte[] unscaledBytes = new byte[buffer.remaining()];\n        tmp.get(unscaledBytes);\n        return new BigDecimal(new BigInteger(unscaledBytes), decimal.scale());\n      case VARIANT:\n        return Variant.from(tmp);\n      case GEOMETRY:\n      case GEOGRAPHY:\n        return GeospatialBound.fromByteBuffer(tmp);\n      case UNKNOWN:\n        // underlying type not known\n        return null;\n      default:\n        throw new UnsupportedOperationException(\"Cannot deserialize type: \" + type);\n    }\n  }\n}\n","sourceCodeStart":195,"sourceCodeEnd":217,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/api/src/main/java/org/apache/iceberg/types/Conversions.java#L195-L217","documentation":"Conversions.internalFromByteBuffer throws UnsupportedOperationException when the supplied type has no deserialization branch, i.e. the typeId is not one of the spec-defined serializable primitives this client supports (e.g. UNKNOWN or a newer spec type).","triggerScenarios":"Calling Conversions.fromByteBuffer with a Type whose typeId falls into the default branch — UNKNOWN types, new geo/variant types on an older client, or a non-primitive type passed by mistake.","commonSituations":"Deserializing partition or lower/upper-bound values for schemas containing newer spec types with an older Iceberg version; generic code iterating all schema fields.","solutions":["Upgrade the Iceberg version supporting the type","Skip unsupported fields when deserializing metadata values","Verify the Type passed is the primitive type matching the serialized bytes"],"exampleFix":"// before\nObject v = Conversions.fromByteBuffer(field.type(), buffer); // field.type() may be unknown\n// after\nif (field.type().typeId() != Type.TypeID.UNKNOWN) {\n  Object v = Conversions.fromByteBuffer(field.type(), buffer);\n}","handlingStrategy":"type-guard","validationCode":"if (type.typeId() == Type.TypeID.UNKNOWN) return null;","typeGuard":"boolean deserializable(Type t) { return t.typeId() != Type.TypeID.UNKNOWN && t.isPrimitiveType(); }","tryCatchPattern":"try { v = Conversions.fromByteBuffer(type, buf); } catch (UnsupportedOperationException e) { v = null; }","preventionTips":["Filter unsupported type ids before deserializing metadata values","Upgrade Iceberg when new spec types are in use","Verify primitive type before conversion"],"tags":["java","deserialization","conversions","unsupported-operation"],"backgroundTag":"unsupported-operation","analyzedSha":"86d9c8fc543e7c56c9f624eb725f76c9baff9570","analyzedAt":"2026-09-12T00:46:39.097Z","contentChangedAt":"2026-09-12T00:46:39.097Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}