{"record":{"id":"4d6fbe8b636cc9f2","repo":"apache/iceberg","slug":"unknown-logical-type-4d6fbe","errorCode":null,"errorMessage":"Unknown logical type: ","messagePattern":"Unknown logical type: ","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"core/src/main/java/org/apache/iceberg/data/avro/PlannedDataReader.java","lineNumber":172,"sourceCode":"            }\n            return GenericReaders.timestampNanos();\n\n          case \"timestamp-millis\":\n            if (AvroSchemaUtil.isTimestamptz(primitive)) {\n              return GenericReaders.timestamptzMillis();\n            }\n            return GenericReaders.timestampMillis();\n\n          case \"decimal\":\n            return ValueReaders.decimal(\n                ValueReaders.decimalBytesReader(primitive),\n                ((LogicalTypes.Decimal) logicalType).getScale());\n\n          case \"uuid\":\n            return ValueReaders.uuids();\n\n          default:\n            throw new IllegalArgumentException(\"Unknown logical type: \" + logicalType);\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":154,"sourceCodeEnd":190,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/core/src/main/java/org/apache/iceberg/data/avro/PlannedDataReader.java#L154-L190","documentation":"PlannedDataReader.primitive() maps Avro primitive types (including logical types like date, timestamp-micros, decimal, uuid) to Iceberg ValueReaders. When a logical type name isn't among the recognized ones, it throws this IllegalArgumentException. The read schema contains a logical type the reader can't map.","triggerScenarios":"Reading Avro data whose schema contains a logical type other than date/time-millis/time-micros/timestamp-millis/timestamp-micros/decimal/uuid (e.g. local-timestamp-micros, duration) via PlannedDataReader.","commonSituations":"Data written by Avro libraries using newer or exotic logical types; schema evolution adding logical types after the reader was written; Avro version differences introducing new logical type names.","solutions":["Identify the unknown logical type from the message and remove or convert it in the write schema.","Upgrade Iceberg to a version recognizing that logical type.","Register/handle the logical type before reading, or map the field to a supported primitive.","If support is missing in Iceberg, add a case for the logical type name in PlannedDataReader."],"exampleFix":"// before\nSchema field = LogicalTypes.duration().addToSchema(Schema.create(Schema.Type.FIXED));\nreader.read(schema, decoder); // Unknown logical type: duration\n// after\nSchema field = LogicalTypes.timestampMicros().addToSchema(Schema.create(Schema.Type.LONG));\nreader.read(schema, decoder);","handlingStrategy":"validation","validationCode":"for (Schema.Field f : schema.getFields()) {\n  LogicalType lt = f.schema().getLogicalType();\n  if (lt != null && !Set.of(\"date\",\"time-millis\",\"time-micros\",\"timestamp-millis\",\"timestamp-micros\",\"decimal\",\"uuid\").contains(lt.getName())) {\n    throw new IllegalArgumentException(\"Unsupported logical type: \" + lt.getName());\n  }\n}","typeGuard":"null","tryCatchPattern":"try { return reader.read(schema, decoder); } catch (IllegalArgumentException e) { if (e.getMessage().startsWith(\"Unknown logical type\")) { return readWithConvertedSchema(convertLogicalTypes(schema), decoder); } throw e; }","preventionTips":["Restrict write-side schemas to logical types the reader knows","Align Avro library versions between producer and consumer","Convert exotic logical types (duration, local-timestamp) before writing"],"tags":["avro","logical-type","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"}