此处为csv至mysql代码
{ "job": { "content": [ { "reader": { "name": "txtfilereader", "parameter": { "path": ["D:/file/test.csv"], "encoding":"gbk", "column": [ { "index": 0, "type": "string" }, { "index": 1, "type": "string" }, { "index": 2, "type": "string" }, ], "fieldDelimiter":"," } }, "writer": { "name": "mysqlwriter", "parameter": { "column": [ "id", "name", "age", ], "connection": [ { "jdbcUrl": "jdbc:mysql://localhost:3306/data?useUnicode=true&characterEncoding=utf8", "table": ["test2"] } ], "password": "root", "username": "root", "writeMode":"insert" } } } ], "setting": { "speed": { "channel": "1" } } } }
截图所示,若我在此处 将type改为int类型 与mysql数据库中的数据类型对应,则会出现脏数据的提示并且插入失败,原因未找到。
解决方法就是全部改成string
原文地址:https://www.cnblogs.com/1061321925wu/p/12385327.html
时间: 2024-10-10 14:19:26