odps数据格式mysql_Datax实现odps和mysql之间数据传输

一、 mysql的数据加载到odps的表中

{

“job”: {

“setting”: {

“speed”: {“byte”: 1048576}

},

“content”: [

{

“reader”: {

“name”: “mysqlreader”,

“parameter”: {

“column”: [

“id”,

“name”,

“password”,

“position”

],

“connection”: [

{

“jdbcUrl”: [“jdbc:mysql://localhost:3306/test”],

“table”: [“user”]

}

],

“password”: “123456”,

“username”: “root”

}

},

“writer”: {

“name”: “odpswriter”,

“parameter”: {

“project”: “project_name”,

“table”: “userwrite”,

“column”: [“id”, “name”,“password”,“position”],

“accessId”: “",

“accessKey”: “************",

“truncate”: true,

“odpsServer”: "http:///api”,

“tunnelServer”: "http://***”,

“accountType”: “aliyun”

}

}

}

]

}

}

二、odps的数据加载到mysql的表中

{

“job”: {

“setting”: {

“speed”: {

“channel”: 1

}

},

“content”: [

{

“reader”: {

“name”: “odpsreader”,

“parameter”: {

“accessId”: “*********”,

“accessKey”: “***************************”,

“project”: “project_name”,

“table”: “test”,

“column”: [

“id”,

“name”,

“age”

],

“splitMode”: “record”,

“odpsServer”: “http://*********************/api”

}

},

“writer”: {

“name”: “mysqlwriter”,

“parameter”: {

“writeMode”: “insert”,

“username”: “test”,

“password”: “123456”,

“column”: [

“id”,

“name”,

“age”

],

“session”: [

“set session sql_mode=‘ANSI’”

],

“connection”: [

{

“jdbcUrl”: “jdbc:mysql://localhost:3306/test?useUnicode=true&characterEncoding=UTF-8”,

“table”: [

“user1”

]

}

]

}

}

}

]

}

}

你可能感兴趣的:(odps数据格式mysql)