简体   繁体   English

无法在OrientDB中导入数据

[英]Can't import data in orientdb

I would like to upload the data in OrientDB, but have errors. 我想在OrientDB中上传数据,但是有错误。 Here is the json file: Try to upload the data in csv file and make the linkage with server and virtualmachine 这是json文件:尝试将数据上传到csv文件中,并与服务器和虚拟机建立链接

{
    "source": {
        "file": {
            "path": "/root/Orientdb/bin/temp/datasets/server.csv"
        }
    },
    "extractor": {
        "row": {}
    },
    "transformers": [{
        "csv": {
            "separator": ",",
            "columnsOnFirstLine": false,
            "columns": ["name", "description", "servercategory", "primarysupport", "secondarysupport", "powersource", "serialnumber", "brand", "model", "serverlocation", "osfamily", "osversion", "cpuspeed", "ram", "numberofprocessor", "cpucorecount", "leftpowersource", "rightpowersource"]
        }
    }, {
        "vertex": {
            "class": "Server"
        }
    }, {
        "merge": {
            "joinFieldName": "virtualhost",
            "lookup": "Server.name"
        }
    }, {
        "edge": {
            "class": "VirtualMachine",
            "joinFieldName": "to",
            "lookup": "Server.name",
            "unresolvedLinkAction": "CREATE"
        }
    }],
    "loader": {
        "orientdb": {
            "dbURL": "plocal:/databases/GratefulDeadConcerts",
            "dbType": "graph",
            "wal": false,
            "batchCommit": 1000,
            "tx": true,
            "txUseLog": false,
            "useLightweightEdges": true,
            "classes": [{
                "name": "Server",
                "extends": "V"
            }, {
                "name": "VirtualMachine",
                "extends": "E"
            }],
            "indexes": [{
                "class": "Server",
                "fields": ["id:name"],
                "type": "UNIQUE"
            }]
        }
    }
}

However, there are errors after run the command (./oetl.sh server.json) . 但是,运行命令(./oetl.sh server.json)之后会出现错误。 What should I do to fix the issue? 我应该怎么做才能解决这个问题? Or i should not create the class (Server and VirtualMachine) before run the script? 或者我不应该在运行脚本之前创建类(服务器和虚拟机)? Thanks. 谢谢。

The error message is 错误消息是

BEGIN ETL PROCESSOR
[file] INFO Reading from file /root/Orientdb/bin/temp/datasets/server.csv with encoding UTF-8
Started execution with 1 worker threads
ETL process has problem: java.lang.IllegalArgumentException: No enum constant com.orientechnologies.orient.core.metadata.schema.OType.NAME
END ETL PROCESSOR
+ extracted 0 rows (0 rows/sec) - 0 rows -> loaded 0 vertices (0 vertices/sec) Total time: 5ms [0 warnings, 0 errors]

我已经在Google网上论坛上回答了您https://groups.google.com/forum/#!topic/orient-database/XxdE3UnhFPA

Please use below merge and edge block in your json and check. 请在json中使用下面的merge和edge块并检查。

{ "merge": { "joinFieldName": "to", "lookup":"Server.name" } }, { "edge": { "class": "VirtualMachine", "joinFieldName":"virtualhost" , "lookup": "Server.name" , "unresolvedLinkAction": "CREATE" } {“ merge”:{“ joinFieldName”:“到”,“ lookup”:“ Server.name”}},{“ edge”:{“ class”:“ VirtualMachine”,“ joinFieldName”:“ virtualhost”,“ lookup “:” Server.name“,” unresolvedLinkAction“:” CREATE“}

Thanks 谢谢

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM