{"record":{"id":"89adaa1b837f285b","repo":"apache/iceberg","slug":"unknown-logical-type-89adaa","errorCode":null,"errorMessage":"Unknown logical type: ","messagePattern":"Unknown logical 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":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.3/flink/src/main/java/org/apache/iceberg/flink/data/FlinkPlannedAvroReader.java#L148-L184","documentation":"In FlinkPlannedAvroReader's ReadBuilder.primitive(...), Avro logical types (logicalType.getName()) are matched by name: decimal, date, time-micros, timestamp-micros, uuid etc. produce dedicated Flink readers; any other logical type name hits the default branch and throws IllegalArgumentException 'Unknown logical type'.","triggerScenarios":"Reading Avro data whose schema declares a logical type name that FlinkPlannedAvroReader does not recognize (e.g. time-millis, local-timestamp-micros, duration, or custom logical types), while planning a reader for the Avro primitive schema.","commonSituations":"Avro files written by newer Iceberg versions supporting logical types this reader doesn't know; third-party producers emitting custom logical type names; version skew where the reader is older than the data producer.","solutions":["Identify the logical type name in the error and the Avro schema; check whether the producing library version supports it and align versions.","Rewrite the data without the unsupported logical type (plain primitive) or with a supported one (decimal/date/timestamp-micros/uuid).","Add a case for the logical type in the switch returning an appropriate reader, and upstream it."],"exampleFix":"// before: Avro field with logicalType \"time-millis\"\n// after: rewrite as \"time-micros\" or plain int with manual conversion","handlingStrategy":"validation","validationCode":"// java\nSet<String> known = Set.of(\"decimal\", \"date\", \"time-micros\", \"timestamp-micros\", \"uuid\");\nObject logical = schema.getLogicalType(null);\nif (logical != null && !known.contains(((org.apache.avro.LogicalType) logical).getName())) {\n  throw new IllegalArgumentException(\"Unsupported Avro logical type\");\n}","typeGuard":null,"tryCatchPattern":"// java\ntry {\n  FlinkAvroReaderFactory/reader = FlinkPlannedAvroReader.create(schema);\n} catch (IllegalArgumentException e) {\n  // handle unknown logical type: rewrite data or upgrade runtime\n}","preventionTips":["Keep the iceberg-flink reader version >= the version of the producer writing the Avro files.","Restrict Avro output to logical types Iceberg supports (decimal, date, timestamp-micros, uuid).","Log the full Avro schema when a reader is created so failures are diagnosable."],"tags":["flink","avro","reader","logical-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"}