forked from tbs005/DataX
-
Notifications
You must be signed in to change notification settings - Fork 0
动态传入参数
binaryWorld edited this page Jun 25, 2016
·
3 revisions
$ cd {YOUR_DATAX_DIR_BIN}
$ python datax.py -p "-Ddate=20160612 -Dhour=01" ./mysql2odps.json
{
"job": {
"content": [
{
"reader": {
"name": "mysqlreader",
"parameter": {
"username": "****",
"password": "****",
"column": ["id","age","name"],
"connection": [
{
"table": [
"test_table"
],
"jdbcUrl": [
"jdbc:mysql://127.0.0.1:3306/test"
]
}
]
}
},
"writer": {
"name": "odpswriter",
"parameter": {
"accessId": "****",
"accessKey": "****",
"column": ["id","age","name"],
"odpsServer": "http://service.odps.aliyun.com/api",
"partition": "pt=$date",
"project": "datax_opensource",
"table": "datax_opensource_test",
"truncate": true
}
}
}
],
"setting": {
"speed": {
"channel": 1
}
}
}
}
运行时,会自动替换为: "partition": "pt=20160612"