{"record":{"id":"81bc579efe65df8e","repo":"alibaba/canal","slug":"the-provided-data-type-doesn-t-map-to-know-any-kno","errorCode":null,"errorMessage":"The provided data type doesn't map to know any known one.","messagePattern":"The provided data type doesn't map to know any known one\\.","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"client-adapter/kudu/src/main/java/com/alibaba/otter/canal/client/adapter/kudu/support/KuduTemplate.java","lineNumber":421,"sourceCode":"     * @param\n     */\n    private Type toKuduType(String mysqlType) throws IllegalArgumentException {\n\n        switch (mysqlType) {\n            case \"varchar\":\n                return Type.STRING;\n            case \"int\":\n                return Type.INT8;\n            case \"decimal\":\n                return Type.DOUBLE;\n            case \"double\":\n                return Type.DOUBLE;\n            case \"datetime\":\n                return Type.STRING;\n            case \"timestamp\":\n                return Type.STRING;\n            default:\n                throw new IllegalArgumentException(\"The provided data type doesn't map to know any known one.\");\n        }\n    }\n}\n","sourceCodeStart":403,"sourceCodeEnd":425,"githubUrl":"https://github.com/alibaba/canal/blob/87be50e87686a3e8af08c368d0e1ffd1f59eb04a/client-adapter/kudu/src/main/java/com/alibaba/otter/canal/client/adapter/kudu/support/KuduTemplate.java#L403-L425","documentation":"Thrown by KuduTemplate.toKuduType() when a MySQL column type string is not one of the handful handled by the switch: varchar, int, decimal, double, datetime, timestamp. Any other type (e.g. bigint, text, tinyint, date, float, char, json) hits the default and aborts. This is a hard limitation of the kudu adapter's type mapping, not a transient failure.","triggerScenarios":"KuduSyncService/KuduTemplate processes a DML whose column type, read from the canal message, is not in the switch's case list; toKuduType() reaches the default branch.","commonSituations":"A source table contains a column type the adapter never mapped (bigint is the most common, since only 'int' -> INT8 is handled). A schema change adds such a column and the next sync fails. Note also that 'int' maps to INT8 (a byte), so integer ranges may already be lossy.","solutions":["Avoid unsupported column types in tables synced to kudu, or exclude them via targetColumns so they are not written.","If you control the code, extend toKuduType() with additional cases (e.g. 'bigint' -> Type.INT64, 'text'/'char' -> Type.STRING) and rebuild the kudu adapter module.","Pre-convert the source column to a supported type (e.g. varchar)."],"exampleFix":"// before: only 6 types handled, everything else throws\n// after: extend the switch\ncase \"bigint\":\n    return Type.INT64;\ncase \"text\":\ncase \"char\":\n    return Type.STRING;\ncase \"float\":\n    return Type.FLOAT;","handlingStrategy":"validation","validationCode":"// Before syncing, check every source column type is one KuduTemplate can map.\nSet<String> supported = Set.of(\"varchar\",\"int\",\"decimal\",\"double\",\"datetime\",\"timestamp\");\nfor (Map.Entry<String,String> e : columnTypes.entrySet()) {\n    if (!supported.contains(e.getValue().toLowerCase())) {\n        throw new IllegalStateException(\n            \"Column \" + e.getKey() + \" has unsupported type \" + e.getValue()\n            + \" for kudu; convert it or exclude it via targetColumns\");\n    }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Audit source schemas for types outside {varchar,int,decimal,double,datetime,timestamp} before pointing kudu sync at them.","Extend toKuduType() with the cases your schemas need and add a unit test per case.","Use targetColumns to exclude columns whose types the adapter cannot map."],"tags":["kudu","type-mapping","canal","schema"],"backgroundTag":null,"analyzedSha":"87be50e87686a3e8af08c368d0e1ffd1f59eb04a","analyzedAt":"2026-08-14T04:30:11.918Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}