0

需要帮助以了解我应该如何使用 csv 文件在 orientdb 中填充我的顶点类。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 凭据不起作用。并且课程与远程登录时的课程不同(启动服务器后)

4

1 回答 1

0

我试过你的代码,它对我有用,这就是我得到的: 在此处输入图像描述

我对您的代码所做的唯一更改是:凭据和 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正确吗?

希望能帮助到你。

问候。

于 2017-06-13T13:37:23.290 回答