orientechnologies / orientechnologies/orientdb-docs
A Question About Import CSV to OrientDB
Nobody has claimed this yet.
- Dominant language
- CSS
- Stars
- 59
- Forks
- 165
- PR merge metrics
- No merged PRs in 30d
Description
Hi.
Currently,i have imported some Vertex into OrientDB .The Class of this Vertex is Con and Org .
Con has one property:CON_NO
Org has one property:ORG_ID
Now,i want to create the Edge between Con and Org by importing CSV file:
"CON_NO","ORG_ID"
"0320003598025860","33401300120"
"063401216000900","33401300151"
"0320009900472364","334013001"
"065859001565252","334013001"
"063493094536700","33401300151"
"063465260717100","33401300130"
I built a Json file like this:
{
"source": { "file": { "path": "/home/Tag_data/bdatag_tag_result.csv" } },
"extractor": { "csv": {"columns":["CON_NO","ORG_ID"]} },
"transformers": [
{ "vertex": { "class": "Org" } },
{ "edge": { "class": "Consume_in",
"joinFieldName": "CON_NO",
"lookup": "Con.CON_NO",
"direction": "in",
"targetVertexFields": { "ORG_ID": "ORG_ID" }
}
}
],
"loader": {
"orientdb": {
"dbURL": "plocal:/home/orientdb/databases/tagdb",
"dbType": "graph",
"classes": [
{"name": "Org", "extends": "V"},
{"name": "Con", "extends": "V"},
{"name": "Consume_in", "extends": "E"}
], "indexes": [
{"class":"Org", "fields":["ORG_ID:String"], "type":"UNIQUE" }
]
}
}
}
but it failed when running OETL.sh
“
2018-11-20 22:38:28:995 SEVER {db=tagdb} Error in Pipeline execution: java.lang.NumberFormatException: For input string: "33401300120" [OETLPipeline]
”
So ,How should i modify my file?
目前我已经在OrientDB中通过CSV导入了2种Vertex节点,对应的Class分别为,Con有和Org.分别含有CON_NO和ORG_IG两个属性。
现在我想通过导入CSV建立Con和Org节点的Edge边,Org与Con的关系为一对多的关系,CSV部分内容如下:
"CON_NO","ORG_ID"
"0320003598025860","33401300120"
"063401216000900","33401300151"
"0320009900472364","334013001"
"065859001565252","334013001"
"063493094536700","33401300151"
"063465260717100","33401300130"
我的OrientDB ETL 的Json文件如下,但是在运行OETL.sh的时候出错了
{
"source": { "file": { "path": "/home/Tag_data/bdatag_tag_result.csv" } },
"extractor": { "csv": {"columns":["CON_NO","ORG_ID"]} },
"transformers": [
{ "vertex": { "class": "Org" } },
{ "edge": { "class": "Consume_in",
"joinFieldName": "CON_NO",
"lookup": "Con.CON_NO",
"direction": "in",
"targetVertexFields": { "ORG_ID": "ORG_ID" }
}
}
],
"loader": {
"orientdb": {
"dbURL": "plocal:/home/orientdb/databases/tagdb",
"dbType": "graph",
"classes": [
{"name": "Org", "extends": "V"},
{"name": "Con", "extends": "V"},
{"name": "Consume_in", "extends": "E"}
], "indexes": [
{"class":"Org", "fields":["ORG_ID:String"], "type":"UNIQUE" }
]
}
}
}
出错信息如下:
2018-11-20 22:38:28:995 SEVER {db=tagdb} Error in Pipeline execution: java.lang.NumberFormatException: For input string: "33401300120" [OETLPipeline]
我应该如何修改我的Json文件呢?
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the OETL.sh command, the JSON configuration, and the CSV column values shown in the issue. Check the OrientDB OETL loader, vertex, edge, and index settings against the reported NumberFormatException. Done means the import completes and creates the intended Consume_in edges between the existing Con and Org vertices.
Written by the indexing model from the issue text.
Assessment
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100