仅从 CSV 文件填充顶点
Populating only vertex from CSV file
需要帮助了解如何使用 csv 文件填充 orientdb 中的顶点 class。 csv 文件中的格式为
name,type,status
xxxxx,ABC,3
yyyyy,ABC,1
zzzzz,123,5
--
我在 OrientDB 中扩展了一个顶点和边,其中顶点有 3 属性 个名称、类型和状态。我只想从 csv 填充顶点,将通过 API
动态创建边
我尝试创建如下 ETL 文件:
{
"source":{"file": { "path": "/tmp/ientdb-community-2.2.18/config/data.csv" } },
"extractor": { "csv": {} },
"transformers": [
{ "vertex": { "class": "MyObject" } }
],
"loader": {
"orientdb": {
"dbURL": "remote:localhost/mydb",
"dbUser": "root",
"dbPassword": "root",
"dbType": "graph",
"classes": [
{"name": "MyObject", "extends": "V"},
], "indexes": [
{"class":"MyObject", "fields":["name:string"], "type":"UNIQUE" }
]
}
}
}
我发现,如果我使用 plocal,root/root 凭据将不起作用。并且 classes 与使用远程登录时(启动服务器后)不同
我试过你的代码,它对我有用,这就是我得到的:
我对您的代码所做的唯一更改是:凭据和 dbUrl plocal 而不是远程:
{
"source":{"file": { "path": "mypath/config/data.csv" } },
"extractor": { "csv": {} },
"transformers": [
{ "vertex": { "class": "MyObject" } }
],
"loader": {
"orientdb": {
"dbURL": "plocal:mypath/databases/mydb",
"dbType": "graph",
"dbUser": "<user name>",
"dbPassword": "<user password>",
**BEGIN UPDATE**
"serverUser": "<server administrator user name, usually root>",
"serverPassword": "<server administrator user password that is provided at server startup>",
**END UPDATE**
"classes": [
{"name": "MyObject", "extends": "V"},
], "indexes": [
{"class":"MyObject", "fields":["name:string"], "type":"UNIQUE" }
]
}
}
}
顺便说一句,我注意到您的路径名为:ientdb-community-2.2.18
对吗?
希望对您有所帮助。
此致。
需要帮助了解如何使用 csv 文件填充 orientdb 中的顶点 class。 csv 文件中的格式为
name,type,status
xxxxx,ABC,3
yyyyy,ABC,1
zzzzz,123,5
--
我在 OrientDB 中扩展了一个顶点和边,其中顶点有 3 属性 个名称、类型和状态。我只想从 csv 填充顶点,将通过 API
动态创建边我尝试创建如下 ETL 文件:
{
"source":{"file": { "path": "/tmp/ientdb-community-2.2.18/config/data.csv" } },
"extractor": { "csv": {} },
"transformers": [
{ "vertex": { "class": "MyObject" } }
],
"loader": {
"orientdb": {
"dbURL": "remote:localhost/mydb",
"dbUser": "root",
"dbPassword": "root",
"dbType": "graph",
"classes": [
{"name": "MyObject", "extends": "V"},
], "indexes": [
{"class":"MyObject", "fields":["name:string"], "type":"UNIQUE" }
]
}
}
}
我发现,如果我使用 plocal,root/root 凭据将不起作用。并且 classes 与使用远程登录时(启动服务器后)不同
我试过你的代码,它对我有用,这就是我得到的:
我对您的代码所做的唯一更改是:凭据和 dbUrl plocal 而不是远程:
{
"source":{"file": { "path": "mypath/config/data.csv" } },
"extractor": { "csv": {} },
"transformers": [
{ "vertex": { "class": "MyObject" } }
],
"loader": {
"orientdb": {
"dbURL": "plocal:mypath/databases/mydb",
"dbType": "graph",
"dbUser": "<user name>",
"dbPassword": "<user password>",
**BEGIN UPDATE**
"serverUser": "<server administrator user name, usually root>",
"serverPassword": "<server administrator user password that is provided at server startup>",
**END UPDATE**
"classes": [
{"name": "MyObject", "extends": "V"},
], "indexes": [
{"class":"MyObject", "fields":["name:string"], "type":"UNIQUE" }
]
}
}
}
顺便说一句,我注意到您的路径名为:ientdb-community-2.2.18
对吗?
希望对您有所帮助。
此致。