forked from gangly/datafaker
-
Notifications
You must be signed in to change notification settings - Fork 0
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
ligangc
committed
Oct 8, 2019
1 parent
cca14ac
commit f784ab4
Showing
2 changed files
with
32 additions
and
23 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
## 六、命令行参数 | ||
|
||
datafaker参数包含4个必选参数和一些可选参数,如下表所示 | ||
|
||
| 参数名 | 含义 | 参数类型| 是否必选 | 默认值 | 备注 | | ||
| ------ | ------ | ------ | ----- | ------| ---- | | ||
|dbtype| 数据源类型 | string | 是 | 无 | 可选值为 rdb,mysql,hive, kafka, file | | ||
| connect | 数据源连接信息 | string| 是 | 无 | 关系型数据库和hive为 sqlachemy的连接串<br>kafka为broker连接串<br>file为文件路径<br>hbase为thrift host和端口| | ||
|table| 表名 | string | 是 | 无 | 将各种数据源操作单位都抽象为表,数据库中为表,kafka中为topic,file为文件名,hbase为表,es为索引和type,mongo为集合| | ||
| num | 数据条数 | int | 是 | 无 | 其中kafka必须为1 | | ||
| auth | 账号密码 | string | 否 | 无 | 数据源的账号密码,以:分隔,例如 admin:12334 | | ||
| meta | 元数据文件 | string | 否 | 无 | 若设定该参数,则忽略从数据源连接信息中读取远数据 | | ||
| interval | 流数据产生间隔 | float | 否 | 1 | 单位秒| | ||
| version | 显示版本号 | bool | 否 | 无 | | | ||
| outprint | 是否在屏幕打印 | bool | 否 | false | 若设置屏幕打印,则数据不会写文件或数据源 | | ||
| outspliter | 数据字段分割符 | string | 否 | , | 屏幕打印,保存文件有效 | | ||
| locale | 语言类型 | string | 否 | zh_CN | 支持多国语言,en_US, zh_CN| | ||
| outfile | 输出到文件 | string | 否 | 无 | | | ||
| format | 数据格式 | string | 否 | text | kafka 默认为json| | ||
| withheader | 打印和存储到文件是否带表头 | bool | 否 | False| | | ||
| batch | 每次批量写入数据源大小 | int | 否 | 1000 | | | ||
| workers | 生成测试数据的线程数 | int | 否 | 4 | | |