Skip to content

Commit

Permalink
feat: support update delete mode (#275)
Browse files Browse the repository at this point in the history
  • Loading branch information
veezhang authored Jun 9, 2023
1 parent 2f92e06 commit ed9f1f4
Show file tree
Hide file tree
Showing 25 changed files with 2,714 additions and 737 deletions.
50 changes: 50 additions & 0 deletions examples/basic/basic.int.delete.v3.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
client:
version: v3
address: "127.0.0.1:9669"
user: root
password: nebula
concurrencyPerAddress: 1
reconnectInitialInterval: 1s
retry: 3
retryInitialInterval: 1s

manager:
spaceName: basic_int_examples
batch: 128
readerConcurrency: 50
importerConcurrency: 512
statsInterval: 10s

log:
level: INFO
console: true
files:
- logs/nebula-importer.log

sources:
- path: ./person.csv
csv:
delimiter: "|"
tags:
- name: Person
mode: DELETE
filter:
expr: Record[3] == "female"
id:
type: "INT"
index: 0
function: hash
- path: ./knows.csv
edges:
- name: KNOWS # person_knows_person
mode: DELETE
filter:
expr: Record[0] != "933"
src:
id:
type: "INT"
index: 0
dst:
id:
type: "INT"
index: 1
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ sources:
alternativeIndices:
- 6
- name: Person
mode: INSERT
filter:
expr: (Record[1] == "Mahinda" or Record[1] == "Michael") and Record[3] == "male"
id:
Expand Down Expand Up @@ -127,8 +128,9 @@ sources:
nullValue: _NULL_
defaultValue: 0000-00-00T00:00:00
- name: KNOWS # person_knows_person
mode: INSERT
filter:
expr: Record[1] == "XXX"
expr: Record[0] != "0"
src:
id:
type: "INT"
Expand Down
64 changes: 64 additions & 0 deletions examples/basic/basic.int.update.v3.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
client:
version: v3
address: "127.0.0.1:9669"
user: root
password: nebula
concurrencyPerAddress: 1
reconnectInitialInterval: 1s
retry: 3
retryInitialInterval: 1s

manager:
spaceName: basic_int_examples
batch: 128
readerConcurrency: 50
importerConcurrency: 512
statsInterval: 10s

log:
level: INFO
console: true
files:
- logs/nebula-importer.log

sources:
- path: ./person.csv
csv:
delimiter: "|"
tags:
- name: Person
mode: UPDATE
filter:
expr: not(Record[1] == "Mahinda")
id:
type: "INT"
index: 0
props:
- name: "browserUsed"
type: "STRING"
index: 7
- path: ./knows.csv
edges:
- name: KNOWS # person_knows_person
mode: UPDATE
filter:
expr: Record[0] != "10995116278700"
src:
id:
type: "INT"
index: 0
function: hash
dst:
id:
type: "INT"
index: 1
function: hash
rank:
index: 0
props:
- name: "creationDate"
type: "DATETIME"
index: 2
nullable: true
nullValue: _NULL_
defaultValue: 0000-00-00T00:00:00
61 changes: 61 additions & 0 deletions examples/basic/basic.string.delete.v3.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
client:
version: v3
address: "127.0.0.1:9669"
user: root
password: nebula
concurrencyPerAddress: 10
reconnectInitialInterval: 1s
retry: 3
retryInitialInterval: 1s

manager:
spaceName: basic_string_examples
batch: 128
readerConcurrency: 50
importerConcurrency: 512
statsInterval: 10s

log:
level: INFO
console: true
files:
- logs/nebula-importer.log

sources:
- path: ./person.csv
csv:
delimiter: "|"
tags:
- name: Person
mode: DELETE
filter:
expr: Record[3] == "female"
id:
type: "STRING"
concatItems:
- person_
- 0
- _id
- path: ./knows.csv
batch: 256
edges:
- name: KNOWS # person_knows_person
mode: DELETE
filter:
expr: Record[0] != "933"
src:
id:
type: "STRING"
concatItems:
- person_
- 0
- _id
dst:
id:
type: "STRING"
concatItems:
- person_
- 1
- _id
rank:
index: 0
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,7 @@ sources:
- name: Person
id:
type: "STRING"
concatItems:
- person_
- 0
- _id
index: 0
props:
- name: "firstName"
type: "STRING"
Expand All @@ -68,14 +65,10 @@ sources:
index: 6
- name: "browserUsed"
type: "STRING"
index: 7
- path: ./person.csv
filter:
expr: Record[1] != "933"
csv:
delimiter: "|"
tags:
- name: Person
mode: INSERT
filter:
expr: (Record[1] == "Mahinda" || Record[1] == "Michael") && Record[3] == "male"
id:
type: "STRING"
concatItems:
Expand Down Expand Up @@ -115,30 +108,22 @@ sources:
src:
id:
type: "STRING"
concatItems:
- person_
- 0
- _id
index: 0
dst:
id:
type: "STRING"
concatItems:
- person_
- 1
- _id
index: 1
props:
- name: "creationDate"
type: "DATETIME"
index: 2
nullable: true
nullValue: _NULL_
defaultValue: 0000-00-00T00:00:00
- path: ./knows.csv
filter:
expr: Record[1] == "XXX"
batch: 256
edges:
- name: KNOWS # person_knows_person
mode: INSERT
filter:
expr: Record[0] != "0"
src:
id:
type: "STRING"
Expand All @@ -153,6 +138,8 @@ sources:
- person_
- 1
- _id
rank:
index: 0
props:
- name: "creationDate"
type: "DATETIME"
Expand Down
61 changes: 61 additions & 0 deletions examples/basic/basic.string.update.v3.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
client:
version: v3
address: "127.0.0.1:9669"
user: root
password: nebula
concurrencyPerAddress: 10
reconnectInitialInterval: 1s
retry: 3
retryInitialInterval: 1s

manager:
spaceName: basic_string_examples
batch: 128
readerConcurrency: 50
importerConcurrency: 512
statsInterval: 10s

log:
level: INFO
console: true
files:
- logs/nebula-importer.log

sources:
- path: ./person.csv
csv:
delimiter: "|"
tags:
- name: Person
mode: UPDATE
filter:
expr: '!(Record[1] == "Mahinda")'
id:
type: "STRING"
index: 0
props:
- name: "browserUsed"
type: "STRING"
index: 7
- path: ./knows.csv
batch: 256
edges:
- name: KNOWS # person_knows_person
mode: UPDATE
filter:
expr: Record[0] != "10995116278700"
src:
id:
type: "STRING"
index: 0
dst:
id:
type: "STRING"
index: 1
props:
- name: "creationDate"
type: "DATETIME"
index: 2
nullable: true
nullValue: _NULL_
defaultValue: 0000-00-00T00:00:00
10 changes: 8 additions & 2 deletions integration-testing/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,14 @@ services:
set -e
nebula-importer -c ./integration-testing/testdata/basic/basic.int.v3.yaml
nebula-importer -c ./integration-testing/testdata/basic/basic.string.v3.yaml
nebula-importer -c ./integration-testing/testdata/basic/basic.int.insert.v3.yaml
nebula-importer -c ./integration-testing/testdata/basic/basic.int.update.v3.yaml
nebula-importer -c ./integration-testing/testdata/basic/basic.int.delete.v3.yaml
nebula-importer -c ./integration-testing/testdata/basic/basic.string.insert.v3.yaml
nebula-importer -c ./integration-testing/testdata/basic/basic.string.update.v3.yaml
nebula-importer -c ./integration-testing/testdata/basic/basic.string.delete.v3.yaml
nebula-importer -c ./integration-testing/testdata/cases-string/cases.string.v3.yaml
nebula-importer -c ./integration-testing/testdata/cases-int/cases.int.v3.yaml
Expand Down
Loading

0 comments on commit ed9f1f4

Please sign in to comment.