{"record":{"id":"0d5c669975c28213","repo":"apache/iceberg","slug":"unsupported-type-0d5c66","errorCode":null,"errorMessage":"Unsupported type: ","messagePattern":"Unsupported type: ","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"core/src/main/java/org/apache/iceberg/data/avro/PlannedDataReader.java","lineNumber":203,"sourceCode":"          return ValueReaders.ints();\n        case LONG:\n          return ValueReaders.longs();\n        case FLOAT:\n          if (partner != null && partner.typeId() == Type.TypeID.DOUBLE) {\n            return ValueReaders.floatsAsDoubles();\n          }\n          return ValueReaders.floats();\n        case DOUBLE:\n          return ValueReaders.doubles();\n        case STRING:\n          // might want to use a binary-backed container like Utf8\n          return ValueReaders.strings();\n        case FIXED:\n          return ValueReaders.fixed(primitive.getFixedSize());\n        case BYTES:\n          return ValueReaders.byteBuffers();\n        default:\n          throw new IllegalArgumentException(\"Unsupported type: \" + primitive);\n      }\n    }\n  }\n}\n","sourceCodeStart":185,"sourceCodeEnd":208,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/core/src/main/java/org/apache/iceberg/data/avro/PlannedDataReader.java#L185-L208","documentation":"PlannedDataReader.primitive() switches over Avro primitive types and throws this IllegalArgumentException in the default branch when the read schema contains a primitive type with no mapping (e.g. an unhandled type such as a record-level mismatch or an exotic primitive). It's the read-side counterpart of DataWriter's unsupported-type error.","triggerScenarios":"Calling PlannedDataReader.read on a schema whose primitive branch falls through the switch — the schema's primitive type is not one of NULL/BOOLEAN/INT/LONG/FLOAT/DOUBLE/STRING/FIXED/BYTES handled above.","commonSituations":"Reading data written with newer Avro/Iceberg types by an older reader; corrupted or hand-built schemas; version skew between writer and reader libraries.","solutions":["Identify the unsupported primitive from the message and align the read schema with supported types.","Upgrade Iceberg so PlannedDataReader supports the type.","Project the schema to exclude the unsupported field before reading.","Add a ValueReaders mapping case if the type should be supported."],"exampleFix":"// before\nreader.read(schemaWithUnsupportedPrimitive, decoder); // throws\n// after\nSchema projected = schema.select(\"supportedField\");\nreader.read(projected, decoder);","handlingStrategy":"validation","validationCode":"for (Schema.Field f : schema.getFields()) {\n  Schema.Type t = f.schema().getType();\n  if (!Set.of(\"NULL\",\"BOOLEAN\",\"INT\",\"LONG\",\"FLOAT\",\"DOUBLE\",\"STRING\",\"FIXED\",\"BYTES\", \"RECORD\",\"ARRAY\",\"MAP\",\"UNION\").contains(t.name())) {\n    throw new IllegalArgumentException(\"Unsupported primitive: \" + t);\n  }\n}","typeGuard":"null","tryCatchPattern":"try { return reader.read(schema, decoder); } catch (IllegalArgumentException e) { if (e.getMessage().startsWith(\"Unsupported type\")) { return reader.read(projectSupported(schema), decoder); } throw e; }","preventionTips":["Match reader library version to writer version","Project out unsupported fields before reading","Round-trip test schemas in CI"],"tags":["avro","reader","unsupported-type","schema"],"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"}