{
"core": {
"transport": {
"channel": {
"speed": {
"record": -1,
"byte": -1
}
}
}
},
"job": {
"content": [{
"reader": {
"name": "mysqlreader",
"parameter": {
"username": "$username",
"password": "$password",
"query":"{'createTime':{$gte:ISODate('$yesterdayfix'),$lt:ISODate('$todayfix')}}", // 取createDate大于等于yesterdayfix且小于todayfix数据
// "query":"{$or:[{'createDate':{$gte:ISODate('$yesterdayfix'),$lt:ISODate('$todayfix')}},{'doneDate':{$gte:ISODate('$yesterdayfix'),$lt:ISODate('$todayfix')}}]}" 取createDate大于等于yesterdayfix且小于todayfix数据,doneDate大于等于yesterdayfix且小于todayfix
// 以下两种方式任选一种即可
// 第一种
"connection": [
{
"querySql": [
"select ACCOUNT_GROUP_PRODUCT_ID,ACCOUNT_GROUP_PRODUCT_CODE,ACCOUNTGROUP_CODE,FAVORABLE_ID,GOODS_NAME,GOODS_ID,PRODUCT_ID,PRODUCT_NAME,PRODUCT_STATE,BUSINESS_TYPE,CUST_ID,STANT_PRICE,BUY_TOTAL_MONEY,FIRSTAMOUNT,PAID_TOTAL_MONEY,FAVORABLE_TOTAL_MOENY,DISCOUNT,SALERID,CAUSE,VIP_ID,STATE,UPDATE_TIME,UPDATE_USER,CREATE_TIME,CREATE_USER,BUY_TYPE,PAYSTATE,AUDITSTATE,EXTINFO,SPECIALSTATE,REMARK,SPECIALTYPE,VERSION,ENTER_TYPE,CONTRACT_NUM,OPERATIONREASON,CONTRACT_ID,CONTRACT_TEXTCODE,CREATER_DEP,CREATER_ORG,PRODUCTTRADE,SUBCOMPANYID,DEPTID,AREAID,OLD_PRODUCT_ID,ISFIRST,ISPAYVOUCHER from EORDER_ACCOUNT_GROUP_PRODUCT;"
],
"jdbcUrl": [
"jdbc:mysql://10.20.0.18:3306/BOSSDB"
]
}
]
// 第二种
"address": [$connstr],
"dbName": "$database",
"collectionName": "$table_name",
"column": [{
"name": "_id",
"type": "string"
},
{
"name": "_class",
"type": "string"
}
]
}
},
"writer": {
"name": "hdfswriter",
"parameter": {
"defaultFS": "$defaultFS",
"fileType": "$fileType",
"path": "$datadir",
"fileName": "$fileName",
"column": [
{"name":"ACCOUNT_GROUP_PRODUCT_ID","type":"string"},
{"name":"ACCOUNT_GROUP_PRODUCT_CODE","type":"string"},
{"name":"ACCOUNTGROUP_CODE","type":"string"},
{"name":"FAVORABLE_ID","type":"string"},
{"name":"GOODS_NAME","type":"string"},
{"name":"GOODS_ID","type":"string"},
{"name":"PRODUCT_ID","type":"string"},
{"name":"ISFIRST","type":"string"},
{"name":"ISPAYVOUCHER","type":"string"}
],
"writeMode": "append",
"fieldDelimiter": "$separator" -- 分割符号; 分隔符\u0001对应hive的\001分割符
}
},
"transformer": [ -- columnIndex下标从0开始
{"name": "dx_replace","parameter": {"columnIndex": 0,"paras": ["0"]}},
{"name": "dx_replace","parameter": {"columnIndex": 1,"paras": ["1"]}},
{"name": "dx_replace","parameter": {"columnIndex": 2,"paras": ["2"]}},
{"name": "dx_replace","parameter": {"columnIndex": 3,"paras": ["3"]}},
{"name": "dx_replace","parameter": {"columnIndex": 4,"paras": ["4"]}},
{"name": "dx_replace","parameter": {"columnIndex": 5,"paras": ["5"]}},
{"name": "dx_replace","parameter": {"columnIndex": 6,"paras": ["6"]}},
{"name": "dx_replace","parameter": {"columnIndex": 7,"paras": ["7"]}},
{"name": "dx_replace","parameter": {"columnIndex": 8,"paras": ["8"]}},
{"name": "dx_replace","parameter": {"columnIndex": 9,"paras": ["9"]}}
]
}],
"setting": {
"speed": {
"channel":1
}
}
}
}