码迷,mamicode.com
首页 > 数据库 > 详细

DATAX 从scv到csv 从csv到mysql

时间:2020-02-28 18:35:44      阅读:154      评论:0      收藏:0      [点我收藏+]

标签:setting   ace   ldd   insert   UNC   odi   ssi   param   root   

csv到csv

 1 {
 2     "setting": {},
 3     "job": {
 4         "setting": {
 5             "speed": {
 6                 "channel": 2
 7             }
 8         },
 9         "content": [
10             {
11                 "reader": {
12                     "name": "txtfilereader",
13                     "parameter": {
14                         "path": ["E:/DATAX/Workplace/TEXT/csv/catalogue.csv"],
15                         "encoding": "UTF-8",
16                         "column": [
17                             {
18                                 "index": 0,
19                                 "type": "string"
20                             },
21                             {
22                                 "index": 1,
23                                 "type": "string"
24                             }
25                         ],
26                         "fieldDelimiter": ",",
27                         "skipHeader": "False"
28                     }
29                 },
30                 "writer": {
31                     "name": "txtfilewriter",
32                     "parameter": {
33                         "path": "E:/DATAX/Workplace/TEXT/csv",
34                         "fileName": "in.csv",
35                         "writeMode": "truncate",
36                         "format": "yyyy-MM-dd",
37                         "header":[id, info]
38                     }
39                 }
40             }
41         ]
42     }
43 }

从csv到mysql

 1 {
 2     "job": {
 3         "setting": {
 4             "speed": {
 5                 "channel": 2
 6             }
 7         },
 8         "content": [
 9             {
10                "reader": {
11                     "name": "txtfilereader",
12                     "parameter": {
13                         "path": ["E:/DATAX/Workplace/TEXT/csv/catalogue.csv"],
14                         "encoding": "UTF-8",
15                         "column": [
16                             {
17                                 "index": 0,
18                                 "type": "string"
19                             },
20                             {
21                                 "index": 1,
22                                 "type": "string"
23                             }
24                         ],
25                         "fieldDelimiter": ",",
26                         "skipHeader": "False"
27                     }
28                 },
29                 
30                "writer": {
31 
32                     "name": "mysqlwriter",
33 
34                     "parameter": {
35 
36                         "writeMode": "insert",
37 
38                         "username": "root",
39 
40                         "password": "zb753951",
41 
42                         "column": [
43 
44                             "name",
45 
46                             "value"
47 
48                         ],
49 
50                         "session": [],
51 
52                         "connection": [
53 
54                             {
55 
56                                 "jdbcUrl": "jdbc:mysql://127.0.0.1:3306/datax?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=GMT%2B8",
57 
58                                 "table": ["csv1"]
59 
60                             }
61 
62                         ]
63 
64                     }
65 
66                 }
67                 
68                 
69             }
70         ]
71     }
72 }

 

DATAX 从scv到csv 从csv到mysql

标签:setting   ace   ldd   insert   UNC   odi   ssi   param   root   

原文地址:https://www.cnblogs.com/smartisn/p/12378250.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!