{"record":{"id":"ac8a2f321b2951e4","repo":"apache/iceberg","slug":"unsupported-type-ac8a2f","errorCode":null,"errorMessage":"Unsupported type: ","messagePattern":"Unsupported type: ","errorType":"exception","errorClass":"java.lang.IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"flink/v2.3/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.3/flink/src/main/java/org/apache/iceberg/flink/data/FlinkPlannedAvroReader.java#L180-L203","documentation":"The same ReadBuilder.primitive(...) maps Avro primitive schema types (STRING, INT, LONG, FLOAT, DOUBLE, BOOLEAN, FIXED, BYTES, ENUM, NULL) to value readers; any remaining Avro type reaches the default branch and throws IllegalArgumentException naming the schema. Since primitive(...) only receives Avro primitives, this guards against unhandled primitives.","triggerScenarios":"Encountering an Avro primitive type not covered by the switch — practically, this is a defensive path hit when a new/unknown Avro primitive appears or when the builder is fed a schema type it never expected.","commonSituations":"Version skew between the Iceberg Flink runtime and the library that produced the Avro schema; custom Avro extensions adding primitive-like types; internal misuse passing a non-primitive schema shape into primitive(...).","solutions":["Check the Avro schema in the error message and align the reader library version with the data producer.","Rewrite the data using standard Avro primitive types covered by the reader.","If a legitimate type is missing, add a case to the switch in ReadBuilder.primitive and upstream the patch."],"exampleFix":"// before: field typed with an unknown primitive variant\n// after: use standard {\"type\":\"bytes\"} or another supported Avro primitive","handlingStrategy":"validation","validationCode":"// java\nswitch (schema.getType()) {\n  case RECORD: case ENUM: case ARRAY: case MAP: case UNION: case FIXED: case STRING:\n  case BYTES: case INT: case LONG: case FLOAT: case DOUBLE: case BOOLEAN: case NULL:\n    break; // supported surface\n  default:\n    throw new IllegalArgumentException(\"Unexpected Avro schema type: \" + schema.getType());\n}","typeGuard":null,"tryCatchPattern":"// java\ntry {\n  reader = FlinkPlannedAvroReader.create(schema);\n} catch (IllegalArgumentException e) {\n  // inspect schema, upgrade runtime or rewrite data\n}","preventionTips":["Only feed standard Avro Schema objects into the reader builder.","Pin matching producer/consumer library versions to avoid new-type skew.","Validate schemas at job submission time instead of first-record read time."],"tags":["flink","avro","reader","unsupported-type"],"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"}