{"record":{"id":"c7489f829fea7df4","repo":"prestodb/presto","slug":"unsupported-type-columntype","errorCode":null,"errorMessage":"unsupported type ${columnType}","messagePattern":"unsupported type (.+?)","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"presto-record-decoder/src/main/java/com/facebook/presto/decoder/json/ISO8601JsonFieldDecoder.java","lineNumber":128,"sourceCode":"                }\n                if (columnType == TIMESTAMP_WITH_TIME_ZONE) {\n                    // Equivalent to:\n                    // ZonedDateTime dateTime = ISO_OFFSET_DATE_TIME.parse(textValue, ZonedDateTime::from);\n                    // packDateTimeWithZone(dateTime.toInstant().toEpochMilli(), getTimeZoneKey(dateTime.getZone().getId()));\n                    TemporalAccessor parseResult = ISO_OFFSET_DATE_TIME.parse(textValue);\n                    return packDateTimeWithZone(parseResult.getLong(INSTANT_SECONDS) * 1000 + parseResult.getLong(MILLI_OF_SECOND), getTimeZoneKey(ZoneId.from(parseResult).getId()));\n                }\n                if (columnType == TIME) {\n                    return ISO_TIME.parse(textValue).getLong(MILLI_OF_DAY);\n                }\n                if (columnType == TIME_WITH_TIME_ZONE) {\n                    TemporalAccessor parseResult = ISO_OFFSET_TIME.parse(textValue);\n                    return packDateTimeWithZone(parseResult.get(MILLI_OF_DAY), getTimeZoneKey(ZoneId.from(parseResult).getId()));\n                }\n                if (columnType == DATE) {\n                    return ISO_DATE.parse(textValue).getLong(EPOCH_DAY);\n                }\n                throw new IllegalArgumentException(\"unsupported type \" + columnType);\n            }\n            catch (DateTimeParseException e) {\n                throw new PrestoException(\n                        DECODER_CONVERSION_NOT_SUPPORTED,\n                        format(\"could not parse value '%s' as '%s' for column '%s'\", value.asText(), columnType, columnHandle.getName()));\n            }\n        }\n    }\n}\n","sourceCodeStart":110,"sourceCodeEnd":138,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-record-decoder/src/main/java/com/facebook/presto/decoder/json/ISO8601JsonFieldDecoder.java#L110-L138","documentation":"Inside ISO8601JsonFieldDecoder.getLong, after handling the supported types (TIMESTAMP, TIME with zone, DATE), any remaining column type reaches an explicit IllegalArgumentException(\"unsupported type \" + columnType). The ISO8601 dataFormat cannot serve that column type; the decoder surface simply doesn't support it. This is a configuration/column-type misuse rather than bad row data.","triggerScenarios":"Declaring a column with dataFormat 'iso8601' whose type is not TIMESTAMP/TIME/TIME WITH TIME ZONE/DATE — e.g. bigint, varchar, or a custom type — causing getLong to fall through to the unsupported-type branch.","commonSituations":"Copy-pasted table definitions where iso8601 was applied to a varchar or bigint column; connector upgrades that validate column types strictly at decode time.","solutions":["Change the column's type to a supported temporal type (DATE, TIME, TIME WITH TIME ZONE, TIMESTAMP) or remove dataFormat","Remove the iso8601 dataFormat so the default decoder handles non-temporal types","Fix the schema in the table definition DDL/JSON","Catch the PrestoException wrapping GENERIC_USER_ERROR at decoder construction time"],"exampleFix":"// before\n{\"name\":\"ts\",\"type\":\"varchar\",\"dataFormat\":\"iso8601\"}\n// after\n{\"name\":\"ts\",\"type\":\"timestamp\",\"dataFormat\":\"iso8601\"} or drop dataFormat","handlingStrategy":"validation","validationCode":"java.util.Set<String> supported = java.util.Set.of(\"date\",\"time\",\"time with time zone\",\"timestamp\"); boolean ok = supported.contains(column.getType().getDisplayName().toLowerCase()) && \"iso8601\".equals(column.getDataFormat());","typeGuard":null,"tryCatchPattern":"try { JsonFieldDecoder d = JsonRowDecoderFactory.create(...); } catch (PrestoException e) { if (e.getErrorCode().getCode() == StandardErrorCode.GENERIC_USER_ERROR.getCode()) { failFast(e.getMessage()); } else throw e; }","preventionTips":["Only apply dataFormat 'iso8601' to temporal column types","Validate column definitions at deploy time with a dry-run decoder factory","Keep type/format pairs in a checked lookup table in your DDL tooling"],"tags":["presto","decoder","configuration","unsupported-type"],"backgroundTag":"unsupported-column-type","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"}