I would like to upload the data in OrientDB, but have errors. Here is the json file: Try to upload the data in csv file and make the linkage with server and virtualmachine
{
"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) . 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.
{ "merge": { "joinFieldName": "to", "lookup":"Server.name" } }, { "edge": { "class": "VirtualMachine", "joinFieldName":"virtualhost" , "lookup": "Server.name" , "unresolvedLinkAction": "CREATE" }
Thanks
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.