- nebula 2.0.1版本
- 部署方式( 单机 ):
- 是否为线上版本:Y
报错信息为:
[root@test-oa-app cmd]# ./nebula-importer --config /home/fintech/nebula-importer/examples/v2/Industry.yaml
2021/07/20 11:12:35 --- START OF NEBULA IMPORTER ---
2021/07/20 11:12:35 yaml: invalid trailing UTF-8 octet
2021/07/20 11:12:36 --- END OF NEBULA IMPORTER ---
Industry.yaml配置为
version: v2
description: example
# 是否删除临时生成的日志和错误数据文件。
removeTempFiles: false
clientSettings:
# nGQL语句执行失败的重试次数。
retry: 3
# Nebula Graph客户端并发数。
concurrency: 10
# 每个Nebula Graph客户端的缓存队列大小。
channelBufferSize: 128
# 指定数据要导入的Nebula Graph图空间。
space: inc_local
# 连接信息。
connection:
user: user
password: password
address: 100.65.240.45:9669
postStart:
# 配置连接Nebula Graph服务器之后,在插入数据之前执行的一些操作。
commands: |
DROP SPACE IF EXISTS inc_local;
CREATE SPACE IF NOT EXISTS inc_local(partition_num=5, 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 IF NOT EXISTS IndustryMinceRelationship(type int DEFAULT 3,level string,relation_type string DEFAULT '细分');
# 执行上述命令后到执行插入数据命令之间的间隔。
afterPeriod: 15s
preStop:
# 配置断开Nebula Graph服务器连接之前执行的一些操作。
commands: |
# 错误等日志信息输出的文件路径。
logPath: ./err/test.log
# CSV文件相关设置。
files:
# 数据文件的存放路径,如果使用相对路径,则会将路径和当前配置文件的目录拼接。本示例第一个数据文件为点的数据。
- path: ./Industry.csv
# 插入失败的数据文件存放路径,以便后面补写数据。
failDataPath: ./err/Industryerr.csv
# 单批次插入数据的语句数量。
batchSize: 10
# 读取数据的行数限制。
limit: 10
# 是否按顺序在文件中插入数据行。如果为false,可以避免数据倾斜导致的导入速率降低。
inOrder: true
# 文件类型,当前仅支持csv。
type: csv
csv:
# 是否有表头。
withHeader: false
# 是否有LABEL。
withLabel: false
# 指定csv文件的分隔符。只支持一个字符的字符串分隔符。
delimiter: ","
schema:
# Schema的类型,可选值为vertex和edge。
type: vertex
vertex:
# 点ID设置。
vid:
# 点ID对应CSV文件中列的序号。CSV文件中列的序号从0开始。
index: 0
# 点ID的数据类型,可选值为int和string,分别对应Nebula Graph中的INT64和FIXED_STRING。
type: string
# 标签设置。
tags:
# 标签名称。
- name: Industry
# 标签内的属性设置。
props:
# 属性名称。
- name: name
# 属性数据类型。
type: string
# 属性对应CSV文件中列的序号。
index: 1
- name: parent
type: string
index: 2
- name: level
type: string
index: 3
- name: is_leaf
type: string
index: 4
- name: remark
type: string
index: 5
- path: ./Industry.csv
failDataPath: ./err/IndustryMinceRelationshiperr.csv
batchSize: 10
limit: 10
inOrder: true
type: csv
csv:
withHeader: false
withLabel: false
schema:
# Schema的类型为edge。
type: edge
edge:
# 边类型名称。
name: IndustryMinceRelationship
# 是否包含rank。
withRanking: false
# 起始点ID设置。
srcVID:
# 数据类型。
type: string
# 起始点ID对应CSV文件中列的序号。
index: 2
# 目的点ID设置。
dstVID:
type: string
index: 0
# 边类型内的属性设置。
props:
# 属性名称。
- level: level
# 属性数据类型。
type: string
# 属性对应CSV文件中列的序号。
index: 3
Industry.csvcsv文件数据为:
3404040518,氨糖软骨素加钙片,34040405,5,1,
3404040517,多维素片,34040405,5,1,
3404040519,母婴营养品,34040405,5,1,
28020102010111,前悬浮拱形座,280201020101,7,1,
3404040514,益生菌粉,34040405,5,1,
61020103,其他玻璃,610201,4,0,
28020102010110,前翼子板,280201020101,7,1,