{"record":{"id":"06a85582b3257973","repo":"alibaba/DataX","slug":"unknown-type-type","errorCode":null,"errorMessage":"unknown type: {type}","messagePattern":"unknown type: (.+?)","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"adswriter/src/main/java/com/alibaba/datax/plugin/writer/adswriter/odps/DataType.java","lineNumber":73,"sourceCode":"     *\n     * @param type 字符串的数据类型\n     * @return byte常量定义的数据类型\n     * @throws IllegalArgumentException\n     */\n    public static byte convertToDataType(String type) throws IllegalArgumentException {\n        type = type.toLowerCase().trim();\n        if (\"string\".equals(type)) {\n            return STRING;\n        } else if (\"bigint\".equals(type) || \"int\".equals(type) || \"tinyint\".equals(type) || \"long\".equals(type)) {\n            return INTEGER;\n        } else if (\"boolean\".equals(type) || \"bool\".equals(type)) {\n            return BOOLEAN;\n        } else if (\"double\".equals(type) || \"float\".equals(type)) {\n            return DOUBLE;\n        } else if (\"datetime\".equals(type)) {\n            return DATETIME;\n        } else {\n            throw new IllegalArgumentException(\"unknown type: \" + type);\n        }\n    }\n\n}\n","sourceCodeStart":55,"sourceCodeEnd":78,"githubUrl":"https://github.com/alibaba/DataX/blob/80ec23d5c5328eb90ca364d2749e92dfaf44541e/adswriter/src/main/java/com/alibaba/datax/plugin/writer/adswriter/odps/DataType.java#L55-L78","documentation":"Thrown by DataType.asType(String) (odps package) when the lowercased, trimmed input string is not one of: string; bigint/int/tinyint/long; boolean/bool; double/float; datetime. It converts a user-facing ODPS type name into the internal byte constant; any unrecognized spelling is rejected with 'unknown type: <value>'.","triggerScenarios":"Calling DataType.asType with strings like 'INT32', 'varchar', 'DECIMAL(10,2)', ' datetime ' with hidden characters, or any type alias not in the accepted list.","commonSituations":"Hand-edited job configuration with an ODPS column type the mapper does not accept; copy-pasting Hive/MySQL types (varchar, decimal) into an ODPS context; invisible whitespace or full-width characters in the type string.","solutions":["Change the column type to one of the supported names: string, bigint, int, tinyint, long, boolean, bool, double, float, datetime","Check for stray whitespace, casing is fine (input is normalized) but verify no non-ASCII look-alike characters","If you need decimal/varchar semantics, map them to double/string at the configuration level"],"exampleFix":"// before\n{\"column\": [\"*\"], \"odpsColumnType\": \"varchar(50)\"} // asType(\"varchar(50)\") throws\n// after\n{\"column\": [\"*\"], \"odpsColumnType\": \"string\"}","handlingStrategy":"validation","validationCode":"static final Set<String> ALLOWED = new HashSet<>(Arrays.asList(\n    \"string\", \"bigint\", \"int\", \"tinyint\", \"long\", \"boolean\", \"bool\", \"double\", \"float\", \"datetime\"));\nString normalized = configuredType.toLowerCase().trim();\nif (!ALLOWED.contains(normalized)) {\n    throw new IllegalArgumentException(\"Unsupported ODPS type: \" + configuredType);\n}","typeGuard":"boolean isSupportedOdpsType(String t) {\n    return t != null && ALLOWED.contains(t.toLowerCase().trim());\n}","tryCatchPattern":"catch (IllegalArgumentException e) {\n  if (e.getMessage().startsWith(\"unknown type:\")) { /* surface the config key holding the bad type */ }\n  throw e;\n}","preventionTips":["Validate ODPS column types against the supported list when parsing job config","Map varchar->string and decimal->double at config-build time"],"tags":["adswriter","odps","type-mapping","configuration"],"backgroundTag":null,"analyzedSha":"80ec23d5c5328eb90ca364d2749e92dfaf44541e","analyzedAt":"2026-08-14T15:33:51.187Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}