{"record":{"id":"aa002c621aa904a0","repo":"alibaba/DataX","slug":"columndatatype-columndatatype","errorCode":null,"errorMessage":"columnDataType={columnDataType}","messagePattern":"columnDataType=(.+?)","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"adswriter/src/main/java/com/alibaba/datax/plugin/writer/adswriter/load/TableMetaHelper.java","lineNumber":77,"sourceCode":"            case ColumnDataType.SHORT:\n            case ColumnDataType.INT:\n            case ColumnDataType.LONG:\n                type = DataType.INTEGER;\n                break;\n            case ColumnDataType.DECIMAL:\n            case ColumnDataType.DOUBLE:\n            case ColumnDataType.FLOAT:\n                type = DataType.DOUBLE;\n                break;\n            case ColumnDataType.DATE:\n            case ColumnDataType.TIME:\n            case ColumnDataType.TIMESTAMP:\n            case ColumnDataType.STRING:\n            case ColumnDataType.MULTI_VALUE:\n                type = DataType.STRING;\n                break;\n            default:\n                throw new IllegalArgumentException(\"columnDataType=\" + columnDataType);\n        }\n        return DataType.toString(type);\n    }\n\n    private static String generateTempTableName(String tableSchema, String tableName) {\n        int randNum = 1000 + new Random(System.currentTimeMillis()).nextInt(1000);\n        return tableSchema + \"__\" + tableName + \"_\" + System.currentTimeMillis() + randNum;\n    }\n\n}\n","sourceCodeStart":59,"sourceCodeEnd":88,"githubUrl":"https://github.com/alibaba/DataX/blob/80ec23d5c5328eb90ca364d2749e92dfaf44541e/adswriter/src/main/java/com/alibaba/datax/plugin/writer/adswriter/load/TableMetaHelper.java#L59-L88","documentation":"Thrown by TableMetaHelper's column-type mapping switch when the incoming ColumnDataType value matches none of the known cases (numeric types, date/time/timestamp, string, multi-value). It is a defensive default branch indicating the switch was extended incompletely or an unrecognized type constant reached the mapper. The message interpolates the offending columnDataType value.","triggerScenarios":"Calling the type-mapping method with a ColumnDataType constant not covered by the switch — e.g. a newly added type (like a new interval/geometry type) or an unexpected byte/ordinal value from the metadata source.","commonSituations":"Upgrading DataX or the metadata provider introduces a new column data type that this adswriter build's switch does not handle; corrupted metadata producing an out-of-range type ordinal.","solutions":["Log or print the columnDataType value in the exception to identify which type is unmapped","If a legitimate new type, add a case to the switch in TableMetaHelper (map to DOUBLE, STRING, etc. as appropriate) and rebuild the plugin","As a workaround, cast/exclude the offending column in the reader/writer column configuration so the unmapped type never reaches the mapper","Align DataX plugin versions so reader and adswriter agree on ColumnDataType constants"],"exampleFix":"// before\ndefault:\n    throw new IllegalArgumentException(\"columnDataType=\" + columnDataType);\n// after (example: support new type)\ncase ColumnDataType.NEWTYPE:\n    type = DataType.STRING;\n    break;\ndefault:\n    throw new IllegalArgumentException(\"columnDataType=\" + columnDataType);","handlingStrategy":"try-catch","validationCode":"// if you control the metadata source, whitelist types before mapping\nSet<ColumnDataType> supported = EnumSet.of(DOUBLE, FLOAT, DATE, TIME, TIMESTAMP, STRING, MULTI_VALUE /* ... */);\nif (!supported.contains(columnDataType)) { /* exclude column or fail with clear message */ }","typeGuard":null,"tryCatchPattern":"catch (IllegalArgumentException e) {\n  if (e.getMessage().startsWith(\"columnDataType=\")) {\n    // log offending type + column, exclude or remap the column, fail the task with context\n  }\n  throw e;\n}","preventionTips":["Keep DataX reader/writer versions aligned so ColumnDataType constants match","Restrict the column list to types you know the mapper supports","When adding a new ColumnDataType, extend every mapping switch the same commit"],"tags":["adswriter","type-mapping","metadata","switch-default"],"backgroundTag":null,"analyzedSha":"80ec23d5c5328eb90ca364d2749e92dfaf44541e","analyzedAt":"2026-08-14T15:33:51.187Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}