nebula Importer 带header导入,导入数据为空

nebula 2

Industry.yaml文件配置如下:

version: v2
description: example
removeTempFiles: false
clientSettings:
  retry: 3
  concurrency: 10 # number of graph clients
  channelBufferSize: 128
  space: inc_local
  connection:
    user: user
    password: password
    address: 100.65.240.45:9669
  postStart:
    commands: |
      CREATE SPACE IF NOT EXISTS inc_local(partition_num=100, replica_factor=1, vid_type=FIXED_STRING(300));
      USE inc_local;
      CREATE TAG IF NOT EXISTS Industry(code string,name string,parent string,level string,is_leaf string,remark string);
      CREATE TAG INDEX IF NOT EXISTS industry_index on Industry(code(300));
      CREATE EDGE IF NOT EXISTS IndustryMinceRelationship(type int DEFAULT 3,level string,relation_type string DEFAULT '细分');
      CREATE EDGE INDEX IF NOT EXISTS industryMinceRelationship on IndustryMinceRelationship();
    afterPeriod: 50s
  preStop:
    commands: |
      USE inc_local;
logPath: ./err/test.log
files:
  - path: ./Industry.csv
    failDataPath: ./err/Industryerr.csv
    batchsize: 10
    limit: 10000000000
    inOrder: true
    type: csv
    csv:
       withHeader: true
       withLabel: true
       delimiter: ","
    schema:
      type: vertex
  - path: ./IndustryMinceRelationship.csv
    failDataPath: ./err/IndustryMinceRelationshiperr.csv
    batchSize: 10
    limit: 10000000000
    inOrder: true
    type: csv
    csv:
      withHeader: true
      withLabel: true
    schema:
      type: edge
      edge:
        name: IndustryMinceRelationship
        withRanking: false

Industry.csv 文件数据如下:

:LABEL,:VID(string),Industry.code:string,Industry.name:string,Industry.parent:string,Industry.level:string,Industry.is_leaf:string,Industry.remark:string
+,in3404040518,3404040518,氨糖软骨素加钙片,34040405,5,1,
+,in3404040517,3404040517,多维素片,34040405,5,1,

/IndustryMinceRelationship.csv文件数据如下:

:LABEL,:DST_VID(string),SRC_VID(string),IndustryMinceRelationship.level:string
+,in3404040518,in34040405,5
+,in3404040517,in34040405,5

报措信息如下:

[root@test-oa-app cmd]# ./nebula-importer --config /home/fintech/nebula-importer/examples/v2/Industry.yaml
2021/07/23 14:01:33 --- START OF NEBULA IMPORTER ---
2021/07/23 14:01:33 [INFO] config.go:311: Invalid batch size in file(/home/fintech/nebula-importer/examples/v2/Industry.csv), reset to 128
2021/07/23 14:01:33 [INFO] config.go:404: files[0].schema.vertex is nil
2021/07/23 14:01:33 [INFO] connection_pool.go:77: [nebula-clients] connection pool is initialized successfully
2021/07/23 14:02:23 [INFO] clientmgr.go:28: Create 10 Nebula Graph clients
2021/07/23 14:02:23 [INFO] reader.go:26: The delimiter of /home/fintech/nebula-importer/examples/v2/Industry.csv is U+002C ','
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x531fbd]

goroutine 31 [running]:
github.com/vesoft-inc/nebula-importer/pkg/config.(*VID).String(0xc000488090, 0x7c6b56, 0x8, 0xc0004860f0, 0xc0004c0c58)
	/home/fintech/nebula-importer/pkg/config/config.go:437 +0x9d
github.com/vesoft-inc/nebula-importer/pkg/config.(*Edge).String(0xc0004aa300, 0x4, 0xc000484120)
	/home/fintech/nebula-importer/pkg/config/config.go:573 +0x725
github.com/vesoft-inc/nebula-importer/pkg/config.(*Schema).String(0xc000488078, 0x47, 0xc000024230)
	/home/fintech/nebula-importer/pkg/config/config.go:367 +0x74
github.com/vesoft-inc/nebula-importer/pkg/reader.(*FileReader).startLog(0xc0004aa2c0)
	/home/fintech/nebula-importer/pkg/reader/reader.go:64 +0x85
github.com/vesoft-inc/nebula-importer/pkg/reader.(*FileReader).Read(0xc0004aa2c0, 0x0, 0x0)
	/home/fintech/nebula-importer/pkg/reader/reader.go:156 +0x613
github.com/vesoft-inc/nebula-importer/pkg/cmd.(*Runner).Run.func2(0xc000026840, 0xc000026880, 0xc0004aa2c0, 0xc000024230, 0x47)
	/home/fintech/nebula-importer/pkg/cmd/runner.go:70 +0x45
created by github.com/vesoft-inc/nebula-importer/pkg/cmd.(*Runner).Run
	/home/fintech/nebula-importer/pkg/cmd/runner.go:69 +0x6b6

找到问题了,是/IndustryMinceRelationship.csv文件header头中SRC_VID(string)少了一个冒号:SRC_VID(string)

1 个赞

既然问题解决了,那就可以勾选为你的回复为【解决方案】方便后续遇到相似问题的小伙伴能快速找到解决方法呀~ 谢谢 liaochunlin

该话题在最后一个回复创建后7天后自动关闭。不再允许新的回复。

浙ICP备20010487号