-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
weiye
committed
Dec 25, 2019
1 parent
f91a6ca
commit 0d71fe7
Showing
4 changed files
with
98 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
# mysql2hive抽取 | ||
|
||
## datax作业配置文件 | ||
|
||
datax.json | ||
|
||
```json | ||
{ | ||
"job": { | ||
"content": [ | ||
{ | ||
"reader": { | ||
"name": "mysqlreader", | ||
"parameter": { | ||
"connection": [ | ||
{ | ||
"jdbcUrl": [ | ||
"jdbc:mysql://127.0.0.1:3306/manual_order?useUnicode=true&characterEncoding=utf-8&useSSL=false&rewriteBatchedStatements=true" | ||
], | ||
"querySql": [ | ||
"select no,name,code,status,province,city,industy,score from test where id < 1000000" | ||
] | ||
} | ||
], | ||
"password": "root", | ||
"username": "root" | ||
} | ||
}, | ||
"writer": { | ||
"name": "hdfswriter", | ||
"parameter": { | ||
"defaultFS": "hdfs://localhost:9000", | ||
"fileType": "text", | ||
"path": "/user/hive/warehouse/offline.db/fgw_company_evaluate_gg/datety=2019-12-24", | ||
"fileName": "test", | ||
"column": [ | ||
{ | ||
"name": "no", | ||
"type": "string" | ||
}, | ||
{ | ||
"name": "name", | ||
"type": "string" | ||
}, | ||
{ | ||
"name": "code", | ||
"type": "string" | ||
}, | ||
{ | ||
"name": "status", | ||
"type": "string" | ||
}, | ||
{ | ||
"name": "province", | ||
"type": "string" | ||
}, | ||
{ | ||
"name": "city", | ||
"type": "string" | ||
}, | ||
{ | ||
"name": "industy", | ||
"type": "string" | ||
}, | ||
{ | ||
"name": "score", | ||
"type": "double" | ||
} | ||
], | ||
"writeMode": "append", | ||
"fieldDelimiter": "," | ||
} | ||
} | ||
} | ||
], | ||
"setting": { | ||
"speed": { | ||
"channel": 2 | ||
} | ||
} | ||
} | ||
} | ||
``` | ||
|
||
- 需要提前创建好分区,分区拼接在path中 | ||
- windows环境下datax执行hdfswriter,hdfs://localhost:9000/user/hive/warehouse/offline.db后面拼接路径符的时候会根据操作系统拼\导致临时文件的为hdfs://localhost:9000/user/hive/warehouse/db\... | ||
删除的时候\后面不识别,会删库 | ||
|
||
|