{"record":{"id":"9e24c18dca8da282","repo":"prestodb/presto","slug":"invalid-dataformat-s-for-column-s","errorCode":null,"errorMessage":"Invalid dataFormat '%s' for column '%s'","messagePattern":"Invalid dataFormat '(.+?)' for column '(.+?)'","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"presto-kafka/src/main/java/com/facebook/presto/kafka/encoder/raw/RawRowEncoder.java","lineNumber":178,"sourceCode":"        {\n            try {\n                return parseInt(group);\n            }\n            catch (NumberFormatException e) {\n                throw new IllegalArgumentException(format(\"Unable to parse '%s' offset for column '%s'\", offsetName, columnName), e);\n            }\n        }\n\n        private static FieldType parseFieldType(String dataFormat, String columnName)\n        {\n            try {\n                if (!dataFormat.isEmpty()) {\n                    return FieldType.valueOf(dataFormat.toUpperCase(Locale.ENGLISH));\n                }\n                return FieldType.BYTE;\n            }\n            catch (IllegalArgumentException e) {\n                throw new IllegalArgumentException(format(\"Invalid dataFormat '%s' for column '%s'\", dataFormat, columnName));\n            }\n        }\n\n        private static void checkFieldType(String columnName, Type columnType, FieldType fieldType)\n        {\n            if (columnType == BIGINT) {\n                checkFieldTypeOneOf(fieldType, columnName, columnType, FieldType.BYTE, FieldType.SHORT, FieldType.INT, FieldType.LONG);\n            }\n            else if (columnType == INTEGER) {\n                checkFieldTypeOneOf(fieldType, columnName, columnType, FieldType.BYTE, FieldType.SHORT, FieldType.INT);\n            }\n            else if (columnType == SMALLINT) {\n                checkFieldTypeOneOf(fieldType, columnName, columnType, FieldType.BYTE, FieldType.SHORT);\n            }\n            else if (columnType == TINYINT) {\n                checkFieldTypeOneOf(fieldType, columnName, columnType, FieldType.BYTE);\n            }\n            else if (columnType == BOOLEAN) {","sourceCodeStart":160,"sourceCodeEnd":196,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-kafka/src/main/java/com/facebook/presto/kafka/encoder/raw/RawRowEncoder.java#L160-L196","documentation":"RawKafkaEncoder's ColumnMapping parses each column's 'dataFormat' property into a FieldType enum via valueOf. If the supplied dataFormat string is not one of the valid FieldType names (e.g. BYTE, SHORT, INT, LONG, FLOAT, DOUBLE, STRING), valueOf throws IllegalArgumentException which is rethrown with the column name for context.","triggerScenarios":"Kafka topic message format definition (CREATE TABLE ... WITH format=...) declares a raw-encoding column with dataFormat set to an unrecognized string such as 'INTEGER' instead of 'INT', or a typo like 'lng'.","commonSituations":"Users copy raw-encoder configs between connectors with different type names; typos in table definitions; case is handled (toUpperCase) so 'int' works but 'integer' or 'int64' does not.","solutions":["Check valid FieldType enum values in RawRowEncoder and use one of them as dataFormat","Fix the typo in the column's dataFormat property","Remove the dataFormat property so the column defaults to BYTE","If an alias like INTEGER is needed, map it to a supported FieldType before valueOf"],"exampleFix":"// before\ndataFormat = 'INTEGER'\n// after\ndataFormat = 'INT'","handlingStrategy":"validation","validationCode":"Set<String> valid = Set.of(\"BYTE\",\"SHORT\",\"INT\",\"LONG\",\"FLOAT\",\"DOUBLE\",\"STRING\");\nif (dataFormat != null && !dataFormat.isEmpty() && !valid.contains(dataFormat.toUpperCase(Locale.ENGLISH))) {\n    throw new IllegalArgumentException(\"Invalid dataFormat '\" + dataFormat + \"' for column '\" + columnName + \"'\");\n}","typeGuard":"boolean isValidFieldType(String dataFormat) {\n    try { FieldType.valueOf(dataFormat.toUpperCase(Locale.ENGLISH)); return true; }\n    catch (IllegalArgumentException e) { return false; }\n}","tryCatchPattern":"try {\n    Map<String,Object> props = parseColumnProps(col);\n} catch (IllegalArgumentException e) {\n    if (e.getMessage().startsWith(\"Invalid dataFormat\")) { log.error(\"Fix dataFormat: {}\", e.getMessage()); }\n    throw e;\n}","preventionTips":["List dataFormat values only from the FieldType enum, not free text","Validate the full table definition against allowed values before CREATE TABLE","Prefer omitting dataFormat to get the BYTE default when unsure"],"tags":["kafka","configuration","enum-parsing"],"backgroundTag":"invalid-enum-value","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"}