{"record":{"id":"7c6703fc4d6d7909","repo":"apache/iceberg","slug":"unknown-primitive-physical-type","errorCode":null,"errorMessage":"Unknown primitive physical type: ","messagePattern":"Unknown primitive physical type: ","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"api/src/main/java/org/apache/iceberg/variants/PhysicalType.java","lineNumber":113,"sourceCode":"      case Primitives.TYPE_DECIMAL8:\n        return DECIMAL8;\n      case Primitives.TYPE_DECIMAL16:\n        return DECIMAL16;\n      case Primitives.TYPE_BINARY:\n        return BINARY;\n      case Primitives.TYPE_STRING:\n        return STRING;\n      case Primitives.TYPE_TIME:\n        return TIME;\n      case Primitives.TYPE_TIMESTAMPTZ_NANOS:\n        return TIMESTAMPTZ_NANOS;\n      case Primitives.TYPE_TIMESTAMPNTZ_NANOS:\n        return TIMESTAMPNTZ_NANOS;\n      case Primitives.TYPE_UUID:\n        return UUID;\n    }\n\n    throw new UnsupportedOperationException(\"Unknown primitive physical type: \" + primitiveType);\n  }\n}\n","sourceCodeStart":95,"sourceCodeEnd":116,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/api/src/main/java/org/apache/iceberg/variants/PhysicalType.java#L95-L116","documentation":"PhysicalType.from maps a variant primitive code (Primitives.*) to its PhysicalType enum. When the byte code does not correspond to any known primitive physical type, this UnsupportedOperationException is thrown. It almost always means corrupt/unsupported variant metadata bytes or a newer spec's type code being read by an older reader.","triggerScenarios":"Calling PhysicalType.from(primitiveType) with an unknown/reserved byte code from variant metadata; reading a variant written by a newer writer that uses primitive codes this version doesn't recognize.","commonSituations":"Corrupted variant buffers on disk; version skew between writer and reader libraries; hand-crafted or fuzzed data reaching the variant decoder.","solutions":["Upgrade the Iceberg dependency so the reader recognizes newer variant primitive type codes","Validate variant metadata buffers before decoding (check header/type codes are in the known set)","Regenerate or re-write the corrupted variant data"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"if (primitiveType < 0 || primitiveType > Primitives.TYPE_UUID) {\n  throw new IllegalStateException(\"unknown variant primitive code: \" + primitiveType);\n}","typeGuard":null,"tryCatchPattern":"try {\n  PhysicalType t = PhysicalType.from(code);\n} catch (UnsupportedOperationException e) {\n  // treat value as unreadable; log and skip the variant value\n}","preventionTips":["Keep the reader library version >= the writer's version","Validate variant metadata bytes before decoding","Never hand-construct primitive type codes"],"tags":["variants","decoding","unsupported"],"backgroundTag":"invalid-enum-value","analyzedSha":"86d9c8fc543e7c56c9f624eb725f76c9baff9570","analyzedAt":"2026-09-12T00:46:39.097Z","contentChangedAt":"2026-09-12T00:46:39.097Z","schemaVersion":2},"datasetVersion":"2026-09-14T21:17:11.552Z"}