vesoft-inc / nebula-importer

Nebula Graph Importer with Go
Apache License 2.0
90 stars 60 forks source link

add working directory to handle the data in different directories #184

Closed knwng closed 2 years ago

knwng commented 2 years ago

Hi everyone, I'm adding this feature to deal with the situation when I want to load the data in different directories with the same structures to the same graph. Without this feature, I have to either change each directory's name to the name I use in the config file, or change the config file every time.

Usage: just add workingDir param to the config file(see the last line). It can be an absolute or relative address, and will be inserted to the address of each files[].path and files[].failDatapath.

version: v2
description: example
removeTempFiles: false
clientSettings:
  retry: 3
  concurrency: 10
  channelBufferSize: 128
  space: relation_graph
  connection:
    user: root
    password: nebula
    address: 192.168.31.147:9669
  postStart:
    commands: |
      DROP SPACE IF EXISTS relation_graph;
      CREATE SPACE IF NOT EXISTS relation_graph(partition_num=1, replica_factor=1, vid_type=INT64);
      USE relation_graph;
      CREATE TAG IF NOT EXISTS identity(data string, collect_time datetime);
      CREATE TAG IF NOT EXISTS email(data string, collect_time datetime);
      CREATE TAG IF NOT EXISTS telephone(data string, collect_time datetime);
      CREATE TAG IF NOT EXISTS province(data string, collect_time datetime);
      CREATE EDGE IF NOT EXISTS identity_email(collect_time datetime);
      CREATE EDGE IF NOT EXISTS identity_telephone(collect_time datetime);
      CREATE EDGE IF NOT EXISTS identity_province(collect_time datetime);
    afterPeriod: 8s
logPath: ./err/test.log
workingDir: ./data/
knwng commented 2 years ago

Nice feature. Could you describe how to use this field in README.md and add some tests in example directory ?

Sure, I'll finish it soon.

knwng commented 2 years ago

Hi @yixinglu, I've updated the README files and provided a testing case in examples/v2/example_with_working_dir.yaml, but I couldn't find a proper version of nebula's docker image to test it, as I've mentioned in https://discuss.nebula-graph.com.cn/t/topic/7029. Which version should I use to test the code? Thank you!

Aiee commented 2 years ago

Hi @yixinglu, I've updated the README files and provided a testing case in examples/v2/example_with_working_dir.yaml, but I couldn't find a proper version of nebula's docker image to test it, as I've mentioned in https://discuss.nebula-graph.com.cn/t/topic/7029. Which version should I use to test the code? Thank you!

Hello @knwng, Sorry for coming back to you late. Currently, the master branch of nebula-importer is capable of the nightly service, as you can see in the Github action we use the nightly nebula service image to test the importer.