{"record":{"id":"cad135d66568906e","repo":"apache/iceberg","slug":"unknown-logical-type-logicaltype-getname","errorCode":null,"errorMessage":"Unknown logical type: ${logicalType.getName()}","messagePattern":"Unknown logical type: (.+?)","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"flink/v1.20/flink/src/main/java/org/apache/iceberg/flink/data/FlinkPlannedAvroReader.java","lineNumber":160,"sourceCode":"\n          case \"timestamp-micros\":\n            return FlinkValueReaders.timestampMicros();\n\n          case \"timestamp-nanos\":\n            return FlinkValueReaders.timestampNanos();\n\n          case \"decimal\":\n            LogicalTypes.Decimal decimal = (LogicalTypes.Decimal) logicalType;\n            return FlinkValueReaders.decimal(\n                ValueReaders.decimalBytesReader(primitive),\n                decimal.getPrecision(),\n                decimal.getScale());\n\n          case \"uuid\":\n            return FlinkValueReaders.uuids();\n\n          default:\n            throw new IllegalArgumentException(\"Unknown logical type: \" + logicalType.getName());\n        }\n      }\n\n      switch (primitive.getType()) {\n        case NULL:\n          return ValueReaders.nulls();\n        case BOOLEAN:\n          return ValueReaders.booleans();\n        case INT:\n          if (partner != null && partner.typeId() == Type.TypeID.LONG) {\n            return ValueReaders.intsAsLongs();\n          }\n          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();","sourceCodeStart":142,"sourceCodeEnd":178,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/flink/v1.20/flink/src/main/java/org/apache/iceberg/flink/data/FlinkPlannedAvroReader.java#L142-L178","documentation":"FlinkPlannedAvroReader.primitive() maps Avro primitives to Flink value readers. When an Avro string/bytes primitive carries a logical type name (via a logicalType conversion), only a fixed set (e.g. decimal, uuid) is recognized; other names throw IllegalArgumentException 'Unknown logical type'.","triggerScenarios":"Reading an Avro-backed Parquet/Avro source whose primitive has a logical type the reader's switch does not cover (anything besides the handled decimal/uuid names in that branch).","commonSituations":"Avro files produced with custom or newer logical types (e.g. time-micros variants in some branches, or vendor-specific names); Iceberg version that predates support for a standard logical type; schema drift between producer and consumer.","solutions":["Identify the logical type name from the message and remove or convert it in the producer schema to a supported type.","Upgrade Iceberg to a version where FlinkPlannedAvroReader handles that logical type.","Cast the column to a plain string/bytes upstream so it no longer carries the unrecognized logical type.","Register a custom conversion or patch the reader switch if the logical type is business-required."],"exampleFix":"// before: Avro field {\"type\":\"bytes\",\"logicalType\":\"custom-thing\"}\n// after: producer writes {\"type\":\"bytes\"} (no logicalType) or converts to supported decimal/uuid","handlingStrategy":"validation","validationCode":"Schema avroSchema = ...;\nfor (Field f : avroSchema.getFields()) {\n  LogicalType lt = AvroSchemaUtil.convert(f.schema()).getLogicalType();\n  if (lt != null && !Set.of(\"decimal\", \"uuid\").contains(lt.getName())) {\n    throw new IllegalArgumentException(\"unsupported avro logical type: \" + lt.getName());\n  }\n}","typeGuard":null,"tryCatchPattern":"try {\n  reader = FlinkPlannedAvroReader.create(readSchema, predicate);\n} catch (IllegalArgumentException e) {\n  if (e.getMessage().startsWith(\"Unknown logical type:\")) {\n    // rebuild read schema without the unsupported logical type\n  }\n}","preventionTips":["Keep producer Avro schemas restricted to standard Iceberg-supported logical types","Upgrade Iceberg when producers introduce newer logical types","Diff producer/consumer schemas in CI"],"tags":["flink","avro","logical-type","unknown-type"],"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-14T16:17:12.679Z"}