{"record":{"id":"a8a637507787913c","repo":"apache/iceberg","slug":"unknown-logical-type-logicaltype-getname-a8a637","errorCode":null,"errorMessage":"Unknown logical type: ${logicalType.getName()}","messagePattern":"Unknown logical type: (.+?)","errorType":"exception","errorClass":"java.lang.IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"flink/v2.1/flink/src/main/java/org/apache/iceberg/flink/data/FlinkPlannedAvroReader.java","lineNumber":166,"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":148,"sourceCodeEnd":184,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/flink/v2.1/flink/src/main/java/org/apache/iceberg/flink/data/FlinkPlannedAvroReader.java#L148-L184","documentation":"FlinkPlannedAvroReader.primitive maps Avro logical types (date, time-micros, timestamp-micros, decimal, uuid) to Flink value readers. When a primitive has a logical type whose name is not among the supported set, the library throws this IllegalArgumentException. It means the Avro file uses a logical type the reader does not recognize.","triggerScenarios":"Reading Avro data containing a primitive with an unrecognized logical type name such as time-millis, timestamp-millis, local-timestamp-micros, or a vendor-specific logical type, via FlinkPlannedAvroReader.","commonSituations":"Avro files written by other systems (Kafka Connect, Confluent serializers) using logical types Iceberg's Flink reader doesn't handle; schema evolution introducing newer logical types.","solutions":["Identify the logical type via the Avro schema and remove/replace it with a supported one (date, time-micros, timestamp-micros, decimal, uuid)","Convert the field to its raw primitive (e.g. write it as long/int/string without a logical type) in the producer","Upgrade Iceberg to a version that supports the logical type, or add a case in FlinkPlannedAvroReader.primitive"],"exampleFix":"// before (producer schema)\n{\"type\":\"long\",\"logicalType\":\"time-millis\"}\n// after\n{\"type\":\"int\",\"logicalType\":\"time-micros\"}","handlingStrategy":"type-guard","validationCode":"Set<String> supported = Set.of(\"date\",\"time-micros\",\"timestamp-micros\",\"decimal\",\"uuid\");\nfor (Schema.Field f : schema.getFields()) {\n  Schema s = f.schema().getTypes().size() == 1 ? f.schema() : f.schema().getTypes().get(1);\n  if (s.getLogicalType() != null && !supported.contains(s.getLogicalType().getName())) {\n    throw new IllegalArgumentException(\"Unsupported logical type: \" + s.getLogicalType().getName());\n  }\n}","typeGuard":"boolean isSupportedLogical(Schema s) {\n  return s.getLogicalType() == null || Set.of(\"date\",\"time-micros\",\"timestamp-micros\",\"decimal\",\"uuid\").contains(s.getLogicalType().getName());\n}","tryCatchPattern":"try { reader = FlinkPlannedAvroReader.create(...); } catch (IllegalArgumentException e) { if (e.getMessage().startsWith(\"Unknown logical type\")) { /* fall back to raw-type reader */ } else throw e; }","preventionTips":["Normalize Avro schemas at produce time to supported logical types","Check schema-registry schemas against the supported list before deploying","Keep Iceberg up to date for new logical type support"],"tags":["avro","flink","logical-type","reader"],"backgroundTag":"schema-validation-failed","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"}