Skip to content

Commit

Permalink
fix: failDataPath is directory (#255)
Browse files Browse the repository at this point in the history
  • Loading branch information
veezhang authored Dec 16, 2022
1 parent 265cadb commit 213a97d
Show file tree
Hide file tree
Showing 7 changed files with 102 additions and 87 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ clientSettings:

The following three configurations are related to the log and data files:

* `workingDir`: **Optional**. If you have multiple directories containing data with the same file structure, you can use this parameter to switch between them. For example, the value of `path` and `failDataPath` of the configuration below will be automatically changed to `./data/student.csv` and `./data/err/student.csv`. If you change workingDir to `./data1`, the path will be changed accordingly. The param can be either absolute or relative.
* `workingDir`: **Optional**. If you have multiple directories containing data with the same file structure, you can use this parameter to switch between them. For example, the value of `path` and `failDataPath` of the configuration below will be automatically changed to `./data/student.csv` and `./data/err/student`. If you change workingDir to `./data1`, the path will be changed accordingly. The param can be either absolute or relative.
* `logPath`: **Optional**. Specifies the log path when importing data. The default path is `/tmp/nebula-importer-{timestamp}.log`.
* `files`: **Required**. It is an array type to configure different data files. You can also import data from a HTTP link by inputting the link in the file path.

Expand All @@ -147,7 +147,7 @@ workingDir: ./data/
logPath: ./err/test.log
files:
- path: ./student.csv
failDataPath: ./err/student.csv
failDataPath: ./err/student
batchSize: 128
limit: 10
inOrder: false
Expand All @@ -163,7 +163,7 @@ files:
One CSV file can only store one type of vertex or edge. Vertices and edges of the different schema must be stored in different files.

* `path`: **Required**. Specifies the path where the data files are stored. If a relative path is used, the `path` and current configuration file directory are spliced. Wildcard filename is also supported, for example: `./follower-*.csv`, please make sure that all matching files with the same schema.
* `failDataPath`: **Required**. Specifies the path for data that failed in inserting so that the failed data are reinserted.
* `failDataPath`: **Required**. Specifies the directory for data that failed in inserting so that the failed data are reinserted.
* `batchSize`: **Optional**. Specifies the batch size of the inserted data. The default value is 128.
* `limit`: **Optional**. Limits the max data reading rows.
* `inOrder`: **Optional**. Whether to insert the data rows in the file in order. If you do not specify it, you avoid the decrease in importing rate caused by the data skew.
Expand Down
6 changes: 3 additions & 3 deletions README_zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ clientSettings:
跟日志和数据文件相关的配置跟以下三个选项有关:
- `workingDir`: **可选**。如果有多个文件夹,里面有相同文件结构的数据,可以使用这个参数在多个文件夹中切换。比如对于下面代码块的配置来说,`path`和`failDataPath`的值会被自动替换成`./data/student.csv`和`./data/err/student.csv`,如果把`workingDir`换成`./data1`,这两个值也会做相应改变。这个参数可以是绝对路径,也可以是相对路径。
- `workingDir`: **可选**。如果有多个文件夹,里面有相同文件结构的数据,可以使用这个参数在多个文件夹中切换。比如对于下面代码块的配置来说,`path`和`failDataPath`的值会被自动替换成`./data/student.csv`和`./data/err/student`,如果把`workingDir`换成`./data1`,这两个值也会做相应改变。这个参数可以是绝对路径,也可以是相对路径。
- `logPath`:**可选**。指定导入过程中的错误等日志信息输出的文件路径,默认输出到 `/tmp/nebula-importer-{timestamp}.log` 中。
- `files`:**必填**。数组类型,用来配置不同的数据文件。您也可以从 HTTP 链接导入数据,在文件路径中输入链接即可。
Expand All @@ -122,7 +122,7 @@ workingDir: ./data/
logPath: ./err/test.log
files:
- path: ./student.csv
failDataPath: ./err/student.csv
failDataPath: ./err/student
batchSize: 128
limit: 10
inOrder: false
Expand All @@ -138,7 +138,7 @@ files:
一个数据文件中只能存放一种点或者边,不同 schema 的点或者边数据需要放置在不同的文件中。
- `path`:**必填**。指定数据文件的存放路径,如果使用相对路径,则会拼接当前配置文件的目录和 `path`。
- `failDataPath`:**必填**。指定插入失败的数据输出的文件,以便后面补写出错数据。
- `failDataPath`:**必填**。指定插入失败的数据输出的文件目录,以便后面补写出错数据。
- `batchSize`:**可选**。批量插入数据的条数,默认 128。
- `limit`:**可选**。限制读取文件的行数。
- `inOrder`:**可选**。是否按序插入文件中的每一行。如果不指定,可以避免数据倾斜导致的导入速率的下降。
Expand Down
62 changes: 31 additions & 31 deletions examples/sf/sf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ clientSettings:
logPath: ./err/test.log
files:
- path: ./social_network/dynamic/person_final.csv
failDataPath: ./err/data/Person.csv
failDataPath: ./err/data/Person
batchSize: 100
type: csv
csv:
Expand Down Expand Up @@ -91,7 +91,7 @@ files:
index: 11

- path: ./social_network/dynamic/forum.csv
failDataPath: ./err/data/Forum.csv
failDataPath: ./err/data/Forum
batchSize: 100
type: csv
csv:
Expand All @@ -116,7 +116,7 @@ files:
index: 2

- path: ./social_network/dynamic/comment.csv
failDataPath: ./err/data/Comment.csv
failDataPath: ./err/data/Comment
batchSize: 100
type: csv
csv:
Expand Down Expand Up @@ -150,7 +150,7 @@ files:
index: 5

- path: ./social_network/dynamic/post.csv
failDataPath: ./err/data/Post.csv
failDataPath: ./err/data/Post
batchSize: 100
type: csv
csv:
Expand Down Expand Up @@ -190,7 +190,7 @@ files:
index: 7

- path: ./social_network/static/tagclass.csv
failDataPath: ./err/data/Tagclass.csv
failDataPath: ./err/data/Tagclass
batchSize: 100
type: csv
csv:
Expand All @@ -215,7 +215,7 @@ files:
index: 2

- path: ./social_network/static/organisation.csv
failDataPath: ./err/data/Organisation.csv
failDataPath: ./err/data/Organisation
batchSize: 100
type: csv
csv:
Expand Down Expand Up @@ -243,7 +243,7 @@ files:
index: 3

- path: ./social_network/static/place.csv
failDataPath: ./err/data/Place.csv
failDataPath: ./err/data/Place
batchSize: 100
type: csv
csv:
Expand Down Expand Up @@ -271,7 +271,7 @@ files:
index: 3

- path: ./social_network/static/tag.csv
failDataPath: ./err/data/Tag.csv
failDataPath: ./err/data/Tag
batchSize: 100
type: csv
csv:
Expand All @@ -296,7 +296,7 @@ files:
index: 2

- path: ./social_network/dynamic/forum_hasModerator_person.csv
failDataPath: ./err/data/HAS_MODERATOR.csv
failDataPath: ./err/data/HAS_MODERATOR
batchSize: 100
type: csv
csv:
Expand All @@ -319,7 +319,7 @@ files:
props:

- path: ./social_network/dynamic/person_likes_comment.csv
failDataPath: ./err/data/LIKES_COMMENT.csv
failDataPath: ./err/data/LIKES_COMMENT
batchSize: 100
type: csv
csv:
Expand All @@ -345,7 +345,7 @@ files:
index: 2

- path: ./social_network/dynamic/forum_hasMember_person.csv
failDataPath: ./err/data/HAS_MEMBER.csv
failDataPath: ./err/data/HAS_MEMBER
batchSize: 100
type: csv
csv:
Expand All @@ -371,7 +371,7 @@ files:
index: 2

- path: ./social_network/dynamic/person_likes_post.csv
failDataPath: ./err/data/LIKES_POST.csv
failDataPath: ./err/data/LIKES_POST
batchSize: 100
type: csv
csv:
Expand All @@ -397,7 +397,7 @@ files:
index: 2

- path: ./social_network/dynamic/post_hasTag_tag.csv
failDataPath: ./err/data/HAS_TAG.csv
failDataPath: ./err/data/HAS_TAG
batchSize: 100
type: csv
csv:
Expand All @@ -420,7 +420,7 @@ files:
props:

- path: ./social_network/dynamic/comment_hasTag_tag.csv
failDataPath: ./err/data/HAS_TAG.csv
failDataPath: ./err/data/HAS_TAG
batchSize: 100
type: csv
csv:
Expand All @@ -443,7 +443,7 @@ files:
props:

- path: ./social_network/dynamic/forum_containerOf_post.csv
failDataPath: ./err/data/CONTAINER_OF.csv
failDataPath: ./err/data/CONTAINER_OF
batchSize: 100
type: csv
csv:
Expand All @@ -466,7 +466,7 @@ files:
props:

- path: ./social_network/dynamic/person_knows_person.csv
failDataPath: ./err/data/KNOWS.csv
failDataPath: ./err/data/KNOWS
batchSize: 100
type: csv
csv:
Expand All @@ -492,7 +492,7 @@ files:
index: 2

- path: ./social_network/dynamic/person_hasInterest_tag.csv
failDataPath: ./err/data/HAS_INTEREST.csv
failDataPath: ./err/data/HAS_INTEREST
batchSize: 100
type: csv
csv:
Expand All @@ -515,7 +515,7 @@ files:
props:

- path: ./social_network/dynamic/person_workAt_organisation.csv
failDataPath: ./err/data/WORK_AT.csv
failDataPath: ./err/data/WORK_AT
batchSize: 100
type: csv
csv:
Expand All @@ -541,7 +541,7 @@ files:
index: 2

- path: ./social_network/dynamic/person_isLocatedIn_place.csv
failDataPath: ./err/data/IS_LOCATED_IN.csv
failDataPath: ./err/data/IS_LOCATED_IN
batchSize: 100
type: csv
csv:
Expand All @@ -564,7 +564,7 @@ files:
props:

- path: ./social_network/dynamic/forum_hasTag_tag.csv
failDataPath: ./err/data/HAS_TAG.csv
failDataPath: ./err/data/HAS_TAG
batchSize: 100
type: csv
csv:
Expand All @@ -587,7 +587,7 @@ files:
props:

- path: ./social_network/dynamic/comment_replyOf_post.csv
failDataPath: ./err/data/REPLY_OF_POST.csv
failDataPath: ./err/data/REPLY_OF_POST
batchSize: 100
type: csv
csv:
Expand All @@ -610,7 +610,7 @@ files:
props:

- path: ./social_network/dynamic/post_isLocatedIn_place.csv
failDataPath: ./err/data/IS_LOCATED_IN.csv
failDataPath: ./err/data/IS_LOCATED_IN
batchSize: 100
type: csv
csv:
Expand All @@ -633,7 +633,7 @@ files:
props:

- path: ./social_network/dynamic/comment_replyOf_comment.csv
failDataPath: ./err/data/REPLY_OF_COMMENT.csv
failDataPath: ./err/data/REPLY_OF_COMMENT
batchSize: 100
type: csv
csv:
Expand All @@ -656,7 +656,7 @@ files:
props:

- path: ./social_network/dynamic/comment_isLocatedIn_place.csv
failDataPath: ./err/data/IS_LOCATED_IN.csv
failDataPath: ./err/data/IS_LOCATED_IN
batchSize: 100
type: csv
csv:
Expand All @@ -679,7 +679,7 @@ files:
props:

- path: ./social_network/dynamic/person_studyAt_organisation.csv
failDataPath: ./err/data/STUDY_AT.csv
failDataPath: ./err/data/STUDY_AT
batchSize: 100
type: csv
csv:
Expand All @@ -705,7 +705,7 @@ files:
index: 2

- path: ./social_network/dynamic/comment_hasCreator_person_new.csv
failDataPath: ./err/data/COMMENT_HAS_CREATOR.csv
failDataPath: ./err/data/COMMENT_HAS_CREATOR
batchSize: 100
type: csv
csv:
Expand Down Expand Up @@ -743,7 +743,7 @@ files:
index: 7

- path: ./social_network/dynamic/post_hasCreator_person_new.csv
failDataPath: ./err/data/POST_HAS_CREATOR.csv
failDataPath: ./err/data/POST_HAS_CREATOR
batchSize: 100
type: csv
csv:
Expand Down Expand Up @@ -787,7 +787,7 @@ files:
index: 9

- path: ./social_network/static/tagclass_isSubclassOf_tagclass.csv
failDataPath: ./err/data/IS_SUBCLASS_OF.csv
failDataPath: ./err/data/IS_SUBCLASS_OF
batchSize: 100
type: csv
csv:
Expand All @@ -810,7 +810,7 @@ files:
props:

- path: ./social_network/static/place_isPartOf_place.csv
failDataPath: ./err/data/IS_PART_OF.csv
failDataPath: ./err/data/IS_PART_OF
batchSize: 100
type: csv
csv:
Expand All @@ -833,7 +833,7 @@ files:
props:

- path: ./social_network/static/tag_hasType_tagclass.csv
failDataPath: ./err/data/HAS_TYPE.csv
failDataPath: ./err/data/HAS_TYPE
batchSize: 100
type: csv
csv:
Expand All @@ -856,7 +856,7 @@ files:
props:

- path: ./social_network/static/organisation_isLocatedIn_place.csv
failDataPath: ./err/data/IS_LOCATED_IN.csv
failDataPath: ./err/data/IS_LOCATED_IN
batchSize: 100
type: csv
csv:
Expand Down
Loading

0 comments on commit 213a97d

Please sign in to comment.