{"record":{"id":"0efdfec1fd2855e9","repo":"apache/iceberg","slug":"unsupported-logical-type-s-0efdfe","errorCode":null,"errorMessage":"Unsupported logical type: %s","messagePattern":"Unsupported logical type: (.+?)","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"parquet/src/main/java/org/apache/iceberg/parquet/ParquetAvroWriter.java","lineNumber":151,"sourceCode":"            switch (primitive.getPrimitiveTypeName()) {\n              case INT32:\n                return ParquetValueWriters.decimalAsInteger(\n                    desc, decimal.getPrecision(), decimal.getScale());\n              case INT64:\n                return ParquetValueWriters.decimalAsLong(\n                    desc, decimal.getPrecision(), decimal.getScale());\n              case BINARY:\n              case FIXED_LEN_BYTE_ARRAY:\n                return ParquetValueWriters.decimalAsFixed(\n                    desc, decimal.getPrecision(), decimal.getScale());\n              default:\n                throw new UnsupportedOperationException(\n                    \"Unsupported base type for decimal: \" + primitive.getPrimitiveTypeName());\n            }\n          case BSON:\n            return ParquetValueWriters.byteBuffers(desc);\n          default:\n            throw new UnsupportedOperationException(\n                \"Unsupported logical type: \" + primitive.getOriginalType());\n        }\n      }\n\n      switch (primitive.getPrimitiveTypeName()) {\n        case FIXED_LEN_BYTE_ARRAY:\n          return new FixedWriter(desc);\n        case BINARY:\n          return ParquetValueWriters.byteBuffers(desc);\n        case BOOLEAN:\n          return ParquetValueWriters.booleans(desc);\n        case INT32:\n          return ParquetValueWriters.ints(desc);\n        case INT64:\n          return ParquetValueWriters.longs(desc);\n        case FLOAT:\n          return ParquetValueWriters.floats(desc);\n        case DOUBLE:","sourceCodeStart":133,"sourceCodeEnd":169,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/parquet/src/main/java/org/apache/iceberg/parquet/ParquetAvroWriter.java#L133-L169","documentation":"ParquetAvroWriter.primitive encountered a Parquet logical (original) type it has no writer mapping for. Only known logical types (DECIMAL, BSON, etc.) are handled in the switch; anything else (e.g., an unrecognized or newly added logical type annotation) triggers this fallback throw.","triggerScenarios":"A Parquet schema contains an OriginalType (logical type annotation) not covered by the switch in primitive() — e.g., UUID, TIME_MICROS on some paths, or a logical type added by a newer Parquet spec than this writer supports.","commonSituations":"Reading/writing files produced by newer Parquet libraries with logical types the pinned parquet-mr/Iceberg version does not recognize; upgrading the writing engine ahead of the Iceberg Avro writer.","solutions":["Upgrade the Iceberg/parquet-mr dependency to a version that supports the logical type","Remove or rewrite the offending column annotation before writing","Use the generic Parquet writer instead of the Avro writer path"],"exampleFix":"// before: column annotated with unsupported logical type (e.g., UUID) written via Avro writer\nParquetAvroWriter<?> writer = ParquetAvro.write(schema).build();\n// after: bump dependency\nimplementation \"org.apache.iceberg:iceberg-parquet:1.6.0\" // supports newer logical types","handlingStrategy":"validation","validationCode":"Set<String> supported = Set.of(\"DECIMAL\",\"BSON\");\nschema.columns().forEach(c -> { if (logicalType(c) != null && !supported.contains(logicalType(c).getName())) throw new IllegalArgumentException(\"Unsupported logical type: \" + logicalType(c)); });","typeGuard":null,"tryCatchPattern":"try { writeTask.commit(); } catch (UnsupportedOperationException e) { if (e.getMessage().startsWith(\"Unsupported logical type\")) { /* fall back to generic writer or upgrade deps */ } else { throw e; } }","preventionTips":["Keep parquet-mr/Iceberg versions current when upstream engines add logical types","Inspect file schemas (parquet-tools) for logical annotations before wiring the Avro writer","Prefer the generic Iceberg Parquet writer for unusual logical types"],"tags":["parquet","avro","logical-type","unsupported-type"],"backgroundTag":"unsupported-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"}