nebula importer 导入报错

import config

# 连接的 Nebula Graph 版本,连接 3.x 时设置为 v3。
version: v3

description: example

# 是否删除临时生成的日志和错误数据文件。
removeTempFiles: false

clientSettings:

  # nGQL 语句执行失败的重试次数。
  retry: 3

  # Nebula Graph 客户端并发数。
  concurrency: 10

  # 每个 Nebula Graph 客户端的缓存队列大小。
  channelBufferSize: 128

  # 指定数据要导入的 Nebula Graph 图空间。
  space: ldbc

  # 连接信息。
  connection:
    user: root
    password: x
    address: 100.82.86.214:9669

  postStart:
    # 配置连接 Nebula Graph 服务器之后,在插入数据之前执行的一些操作。
    commands: |
      DROP SPACE IF EXISTS ldbc;
      CREATE SPACE IF NOT EXISTS ldbc(partition_num=1, replica_factor=1, vid_type=FIXED_STRING(20));
      USE ldbc;
      CREATE EDGE knows(creationDate timestamp);

    # 执行上述命令后到执行插入数据命令之间的间隔。
    afterPeriod: 15s

  preStop:
    # 配置断开 Nebula Graph 服务器连接之前执行的一些操作。
    commands: |

# 错误等日志信息输出的文件路径。
logPath: ./err/test.log

# CSV 文件相关设置。
files:

    # 数据文件的存放路径,如果使用相对路径,则会将路径和当前配置文件的目录拼接。本示例第一个数据文件为点的数据。
  - path: ./person_knows_person_0_0.csv

    # 插入失败的数据文件存放路径,以便后面补写数据。
    failDataPath: ./err/studenterr.csv

    # 单批次插入数据的语句数量。
    batchSize: 10

    # 读取数据的行数限制。
    limit: 10

    # 是否按顺序在文件中插入数据行。如果为 false,可以避免数据倾斜导致的导入速率降低。
    inOrder: true

    # 文件类型,当前仅支持 csv。
    type: csv

    csv:
      # 是否有表头。
      withHeader: true

      # 是否有 LABEL。
      withLabel: false

      # 指定 csv 文件的分隔符。只支持一个字符的字符串分隔符。
      delimiter: "|"

    schema:
      # Schema 的类型,可选值为 vertex 和 edge。
      type: edge
      edge:
            name: knows
            srcVID:
              index: 0
              function: hash
            dstVID:
              index: 1
              function: uuid
            props:
              - name: creationDate
                type: timestamp
                index: 2

导入数据:

:SRC_VID(int),:DST_VID(int),knows.creationDate:timestamp
933|2199023674456|2010-03-26T09:37:11.786+0000
933|4398046602614|2010-06-24T09:32:01.402+0000

报错信息:

2022/04/20 20:09:54 --- START OF NEBULA IMPORTER ---
2022/04/20 20:09:54 [WARN] config.go:554: Not set files[0].schema.edge.srcVID.Type, reset to default value `string'
2022/04/20 20:09:54 [WARN] config.go:554: Not set files[0].schema.edge.dstVID.Type, reset to default value `string'
2022/04/20 20:10:09 [INFO] clientmgr.go:28: Create 10 Nebula Graph clients
2022/04/20 20:10:09 [INFO] reader.go:26: The delimiter of /home/jilong.yjl/nebula-importer/person_knows_person_0_0.csv is U+007C '|'
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x532b1d]

goroutine 146 [running]:
github.com/vesoft-inc/nebula-importer/pkg/config.(*VID).String(0xc00000c300, 0x7d8635, 0x8, 0xc000016420, 0xd)
        /home/runner/work/nebula-importer/nebula-importer/pkg/config/config.go:500 +0x9d
github.com/vesoft-inc/nebula-importer/pkg/config.(*Edge).String(0xc000528240, 0x4, 0xc000016400)
        /home/runner/work/nebula-importer/nebula-importer/pkg/config/config.go:639 +0x594
github.com/vesoft-inc/nebula-importer/pkg/config.(*Schema).String(0xc00000c2b8, 0x3c, 0xc0000203c0)
        /home/runner/work/nebula-importer/nebula-importer/pkg/config/config.go:430 +0x74
github.com/vesoft-inc/nebula-importer/pkg/reader.(*FileReader).startLog(0xc000528200)
        /home/runner/work/nebula-importer/nebula-importer/pkg/reader/reader.go:64 +0x85
github.com/vesoft-inc/nebula-importer/pkg/reader.(*FileReader).Read(0xc000528200, 0x0, 0x0, 0x0)
        /home/runner/work/nebula-importer/nebula-importer/pkg/reader/reader.go:156 +0x633
github.com/vesoft-inc/nebula-importer/pkg/cmd.(*Runner).Run.func2(0xc0001668c0, 0xc000166880, 0xc000528200, 0xc0000203c0, 0x3c)
        /home/runner/work/nebula-importer/nebula-importer/pkg/cmd/runner.go:70 +0x45
created by github.com/vesoft-inc/nebula-importer/pkg/cmd.(*Runner).Run
        /home/runner/work/nebula-importer/nebula-importer/pkg/cmd/runner.go:69 +0x6b6

这里的 vid 是 string 啊,但是你导入的数据又是 int 类型的点。所以报错了。

报错信息哪里能看到这个问题吗?

这个,:joy: 我刚开始以为是你的 int vid 的值超过我们的 int 存储上限。不过我又看了一眼你的配置信息。这个报错信息还是挺明显的,就是你的类型不是默认的 string(我英文不大好大概是这个意思)

为啥表头的分隔符和数据不一样?

这个是照着例子写的。。

:joy: 因为官方用的英文字符 , 来当分隔符的。所以你现在问题解决了吗?

此话题已在最后回复的 30 天后被自动关闭。不再允许新回复。