1、脚本
{
"job": {
"setting": {
"speed": {
"channel": 3
}
},
"content": [
{
"reader": {
"name": "hdfsreader",
"parameter": {
"path": "/user/hive/warehouse/ods.db/ods_basic_info/*",
"defaultFS": "hdfs://node03:9000",
"column": [
{
"index": 0,
"type": "string"
},
{
"index": 1,
"type": "string"
},
{
"type": "string",
"value": ""
},
{
"index": 3,
"type": "string",
},
{
"type": "string",
"value": "自定义赋值",
},
{
"index": 5,
"type": "string",
},
{
"index": 6,
"type": "string",
},
{
"index": 7,
"type": "string",
}
],
"fileType": "text",
"encoding": "UTF-8",
"fieldDelimiter": "|"
}
},
"writer": {
"name": "mysqlwriter",
"parameter": {
"writeMode": "insert",
"username": "root",
"password": "123456",
"column": [
"tar_comany_id",
"tar_corporation_code",
"tar_company",
"tar_corporation_person",
"tar_province_code",
"tar_province",
"tar_city_code",
"tar_city"
],
"session": [
"set session sql_mode='ANSI'"
],
"preSql": [
"truncate table basic_info"
],
"connection": [
{
"jdbcUrl": "jdbc:mysql://node03:30005/cp_test?useUnicode=true&characterEncoding=gbk",
"table": [
"basic_info"
]
}
]
}
}
}
]
}
}