簡體   English   中英

無法在OrientDB中導入數據

[英]Can't import data in orientdb

我想在OrientDB中上傳數據,但是有錯誤。 這是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"
            }]
        }
    }
}

但是,運行命令(./oetl.sh server.json)之后會出現錯誤。 我應該怎么做才能解決這個問題? 或者我不應該在運行腳本之前創建類(服務器和虛擬機)? 謝謝。

錯誤消息是

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

請在json中使用下面的merge和edge塊並檢查。

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

謝謝

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM