{"record":{"id":"0b297ca78a0e8929","repo":"prestodb/presto","slug":"not-supported-0b297c","errorCode":"NOT_SUPPORTED","errorMessage":"Type not supported for Iceberg: ","messagePattern":"Type not supported for Iceberg: ","errorType":"error_code","errorClass":"PrestoException","httpStatus":null,"severity":"error","filePath":"presto-iceberg/src/main/java/com/facebook/presto/iceberg/TypeConverter.java","lineNumber":231,"sourceCode":"        if (type instanceof ArrayType) {\n            return fromArray((ArrayType) type);\n        }\n        if (type instanceof MapType) {\n            return fromMap((MapType) type);\n        }\n        if (type instanceof TimeType) {\n            return Types.TimeType.get();\n        }\n        if (type instanceof TimestampType) {\n            return Types.TimestampType.withoutZone();\n        }\n        if (type instanceof TimestampWithTimeZoneType) {\n            return Types.TimestampType.withZone();\n        }\n        if (type instanceof UuidType) {\n            return Types.UUIDType.get();\n        }\n        throw new PrestoException(NOT_SUPPORTED, \"Type not supported for Iceberg: \" + type.getDisplayName());\n    }\n\n    public static HiveType toHiveType(Type type)\n    {\n        return HiveType.toHiveType(toHiveTypeInfo(type));\n    }\n\n    private static org.apache.iceberg.types.Type fromDecimal(DecimalType type)\n    {\n        return Types.DecimalType.of(type.getPrecision(), type.getScale());\n    }\n\n    public static org.apache.iceberg.types.Type fromRow(RowType type, int startId)\n    {\n        List<Types.NestedField> fields = new ArrayList<>();\n        for (RowType.Field field : type.getFields()) {\n            String name = field.getName().orElseThrow(() ->\n                    new PrestoException(NOT_SUPPORTED, \"Row type field does not have a name: \" + type.getDisplayName()));","sourceCodeStart":213,"sourceCodeEnd":249,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-iceberg/src/main/java/com/facebook/presto/iceberg/TypeConverter.java#L213-L249","documentation":"toIcebergType converts Presto types to Iceberg types. After handling all known mappings (including timestamp with time zone and UUID), any remaining type reaches the fallthrough throw PrestoException(NOT_SUPPORTED, \"Type not supported for Iceberg: <displayName>\"). The connector cannot represent that Presto type in an Iceberg schema.","triggerScenarios":"CREATE TABLE AS / CREATE TABLE with Iceberg using a Presto type with no Iceberg counterpart — e.g. timestamp without time zone in older versions, time, IPADDRESS, hyperloglog, setdigest, json (in some versions), or other non-mapped types.","commonSituations":"CTAS from a Hive/JDBC table carrying exotic types into Iceberg; using internal/aggregate types (HyperLogLog, SetDigest) as columns; timestamp columns without time zone on connectors/versions lacking mapping.","solutions":["Replace the unsupported column type with a supported equivalent (e.g. timestamp(3) with time zone instead of timestamp, VARCHAR instead of json where needed)","Cast unsupported columns during CTAS: CAST(ts AS timestamp(3) with time zone)","For opaque types (HyperLogLog, SetDigest), store serialized VARBINARY instead","Check connector docs/version for the supported type-mapping table and upgrade Presto if a mapping was added later"],"exampleFix":"// before\nCREATE TABLE iceberg.t (ts timestamp) ...\n// after\nCREATE TABLE iceberg.t (ts timestamp(3) with time zone) ...","handlingStrategy":"validation","validationCode":"Set<String> unsupported = Set.of(\"time\", \"ipaddress\", \"hyperloglog\", \"setdigest\", \"json\");\nfor (ColumnDef c : columns) {\n    if (unsupported.contains(c.typeBase())) throw new IllegalArgumentException(\"Type not supported for Iceberg: \" + c.type);\n}","typeGuard":"boolean isIcebergCompatible(Type t) {\n    return t instanceof BooleanType || t instanceof IntegerType || t instanceof BigIntType\n        || t instanceof RealType || t instanceof DoubleType || t instanceof DecimalType\n        || t instanceof VarcharType || t instanceof CharType || t instanceof VarbinaryType\n        || t instanceof DateType || t instanceof TimestampWithTimeZoneType || t instanceof UuidType;\n}","tryCatchPattern":"try { /* CREATE TABLE / CTAS on iceberg */ } catch (PrestoException e) {\n    if (e.getErrorCode().getName().equals(\"NOT_SUPPORTED\")) {\n        // message names the unsupported type; cast or redesign the schema\n    } else { throw e; }\n}","preventionTips":["Map unsupported types up front: timestamp -> timestamp(3) with time zone, json -> VARCHAR","Never use opaque/aggregate types (HyperLogLog, SetDigest) as Iceberg columns — use VARBINARY","Consult the connector's type mapping table for your Presto version before DDL","Cast explicitly in CTAS to avoid implicit-mapping failures"],"tags":["iceberg","type-mapping","not-supported"],"backgroundTag":"type-not-supported","analyzedSha":"55bb57d202de3b926896fa966c2c4a44c779634e","analyzedAt":"2026-09-04T12:50:26.162Z","contentChangedAt":"2026-09-04T12:50:26.162Z","schemaVersion":2},"datasetVersion":"2026-09-11T21:17:09.523Z"}