{"record":{"id":"f99e41c9ad8a7d36","repo":"apache/iceberg","slug":"unsupported-type-primitive-f99e41","errorCode":null,"errorMessage":"Unsupported type: \" + primitive","messagePattern":"Unsupported type: \" \\+ primitive","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"flink/v2.2/flink/src/main/java/org/apache/iceberg/flink/data/FlinkPlannedAvroReader.java","lineNumber":198,"sourceCode":"        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          return FlinkValueReaders.strings();\n        case FIXED:\n          return ValueReaders.fixed(primitive.getFixedSize());\n        case BYTES:\n          return ValueReaders.bytes();\n        case ENUM:\n          return FlinkValueReaders.enums(primitive.getEnumSymbols());\n        default:\n          throw new IllegalArgumentException(\"Unsupported type: \" + primitive);\n      }\n    }\n  }\n}\n","sourceCodeStart":180,"sourceCodeEnd":203,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/flink/v2.2/flink/src/main/java/org/apache/iceberg/flink/data/FlinkPlannedAvroReader.java#L180-L203","documentation":"FlinkPlannedAvroReader's primitive switch handles fixed Avro primitive types (NULL, BOOLEAN, INT, LONG, FLOAT, DOUBLE, STRING, RECORD, MAP, LIST, UNION, FIXED, BYTES, ENUM); any other Avro type reaches the default branch and throws IllegalArgumentException 'Unsupported type: <primitive>'. This fails fast for Avro constructs the planned reader cannot decode.","triggerScenarios":"Building a reader for an Avro schema containing an exotic primitive type outside the handled set (rare, e.g. non-standard extensions) through FlinkPlannedAvroReader.primitive.","commonSituations":"Malformed or vendor-extended Avro schemas, reading files whose schema was tampered with, or using an Avro feature ahead of the Iceberg version's support.","solutions":["Inspect the Avro schema and normalize the unsupported type to a standard Avro primitive","Regenerate/rewrite the data with a standard Avro schema","Upgrade Iceberg if the type is newly standardized and supported in later versions"],"exampleFix":"// before: schema contains non-standard type extension\n// after: use standard Avro types, e.g.\n{\"type\":\"string\"} instead of vendor extension","handlingStrategy":"try-catch","validationCode":"Preconditions.checkArgument(KNOWN_AVRO_TYPES.contains(avroType.getType()),\n    \"Unsupported Avro type: \" + avroType.getType());\n// KNOWN_AVRO_TYPES = NULL, BOOLEAN, INT, LONG, FLOAT, DOUBLE, STRING,\n// RECORD, ENUM, ARRAY, MAP, UNION, FIXED, BYTES","typeGuard":null,"tryCatchPattern":"try {\n  reader = builder.primitive(primitive);\n} catch (IllegalArgumentException e) {\n  throw new AvroReadException(\"Unsupported Avro primitive: \" + e.getMessage(), e);\n}","preventionTips":["Validate Avro schemas at ingestion with standard Avro type list","Reject vendor-extended schemas before writing files","Keep Iceberg upgraded so newly standardized types are supported"],"tags":["flink","avro","unsupported"],"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"}