Hi,
but unfortunately i got error.
Here are CSV's
1. post.csv
id,title
10,NoSQL movement
20,New OrientDB
2. comments.csv
id,postId,text
0,10,First
1,10,Second
21,10,Another
41,20,First again
82,20,Second Again
JSON files
1. post.json
{
"source": { "file": { "path": "/tmp/post.csv" } },
"extractor": { "row": {} },
"transformers": [
{ "csv": {} },
{ "vertex": { "class": "Post" } }
],
"loader": {
"orientdb": {
"dbURL": "remote:localhost/Blog",
"dbType": "graph",
"classes": [
{"name": "Post", "extends": "V"},
{"name": "Comment", "extends": "V"},
{"name": "HasComments", "extends": "E"}
], "indexes": [
{"class":"Post", "fields":["id:integer"], "type":"UNIQUE" }
]
}
}
}
2. comments.json
{
"source": { "file": { "path": "/tmp/comments.csv" } },
"extractor": { "row": {} },
"transformers": [
{ "csv": {} },
{ "vertex": { "class": "Comment" } },
{ "edge": { "class": "HasComments",
"joinFieldName": "postId",
"lookup": "Post.id",
"direction": "in"
}
}
],
"loader": {
"orientdb": {
"dbURL": "remote:localhost/Blog",
"dbType": "graph",
"classes": [
{"name": "Post", "extends": "V"},
{"name": "Comment", "extends": "V"},
{"name": "HasComments", "extends": "E"}
], "indexes": [
{"class":"Post", "fields":["id:integer"], "type":"UNIQUE" }
]
}
}
}
Here is ETL log :
root@proteus:~/orientdb-enterprise-2.1.0/bin# ./oetl.sh /tmp/post.json
BEGIN ETL PROCESSOR
+ extracted 0 rows (0 rows/sec) - 0 rows -> loaded 0 vertices (0 vertices/sec) Total time: 1000ms [0 warnings, 0 errors]
+ extracted 0 rows (0 rows/sec) - 0 rows -> loaded 0 vertices (0 vertices/sec) Total time: 2s [0 warnings, 0 errors]
+ extracted 0 rows (0 rows/sec) - 0 rows -> loaded 0 vertices (0 vertices/sec) Total time: 3s [0 warnings, 0 errors]
+ extracted 0 rows (0 rows/sec) - 0 rows -> loaded 0 vertices (0 vertices/sec) Total time: 4s [0 warnings, 0 errors]
+ extracted 0 rows (0 rows/sec) - 0 rows -> loaded 0 vertices (0 vertices/sec) Total time: 5s [0 warnings, 0 errors]
+ extracted 0 rows (0 rows/sec) - 0 rows -> loaded 0 vertices (0 vertices/sec) Total time: 6s [0 warnings, 0 errors]
+ extracted 0 rows (0 rows/sec) - 0 rows -> loaded 0 vertices (0 vertices/sec) Total time: 7s [0 warnings, 0 errors]
+ extracted 0 rows (0 rows/sec) - 0 rows -> loaded 0 vertices (0 vertices/sec) Total time: 8s [0 warnings, 0 errors]
+ extracted 0 rows (0 rows/sec) - 0 rows -> loaded 0 vertices (0 vertices/sec) Total time: 9s [0 warnings, 0 errors]
+ extracted 0 rows (0 rows/sec) - 0 rows -> loaded 0 vertices (0 vertices/sec) Total time: 10s [0 warnings, 0 errors]
+ extracted 0 rows (0 rows/sec) - 0 rows -> loaded 0 vertices (0 vertices/sec) Total time: 11s [0 warnings, 0 errors]
+ extracted 0 rows (0 rows/sec) - 0 rows -> loaded 0 vertices (0 vertices/sec) Total time: 12s [0 warnings, 0 errors]
+ extracted 0 rows (0 rows/sec) - 0 rows -> loaded 0 vertices (0 vertices/sec) Total time: 13s [0 warnings, 0 errors]
+ extracted 0 rows (0 rows/sec) - 0 rows -> loaded 0 vertices (0 vertices/sec) Total time: 14s [0 warnings, 0 errors]
+ extracted 0 rows (0 rows/sec) - 0 rows -> loaded 0 vertices (0 vertices/sec) Total time: 15s [0 warnings, 0 errors]
END ETL PROCESSOR
+ extracted 3 rows (8 rows/sec) - 3 rows -> loaded 2 vertices (5 vertices/sec) Total time: 15370ms [0 warnings, 0 errors]
root@proteus:~/orientdb-enterprise-2.1.0/bin# ./oetl.sh /tmp/comments.json
BEGIN ETL PROCESSOR
Error in Pipeline execution: java.lang.NullPointerException
java.lang.NullPointerException
at com.orientechnologies.orient.etl.transformer.OEdgeTransformer.createEdge(OEdgeTransformer.java:186)
at com.orientechnologies.orient.etl.transformer.OEdgeTransformer.executeTransform(OEdgeTransformer.java:117)
at com.orientechnologies.orient.etl.transformer.OAbstractTransformer.transform(OAbstractTransformer.java:37)
at com.orientechnologies.orient.etl.OETLPipeline.execute(OETLPipeline.java:114)
at com.orientechnologies.orient.etl.OETLProcessor.executeSequentially(OETLProcessor.java:487)
at com.orientechnologies.orient.etl.OETLProcessor.execute(OETLProcessor.java:291)
at com.orientechnologies.orient.etl.OETLProcessor.main(OETLProcessor.java:161)
ETL process halted: com.orientechnologies.orient.etl.OETLProcessHaltedException: java.lang.NullPointerException
root@proteus:~/orientdb-enterprise-2.1.0/bin#
Here is debug output from last load :root@proteus:~/orientdb-community-2.1.0/bin# ./oetl.sh /tmp/comments.json
BEGIN ETL PROCESSOR
[file] DEBUG Reading from file /tmp/comments.csv
[orientdb] DEBUG orientdb: found 2 vertices in class 'null'
[orientdb] DEBUG orientdb: found 0 vertices in class 'null'
[orientdb] DEBUG orientdb: found 0 vertices in class 'null'
[0:csv] DEBUG Transformer input: id,postId,text
[0:csv] DEBUG parsing=id,postId,text
[0:csv] DEBUG Transformer output: null
2015-08-25 20:47:22:644 WARNI {db=Blog} Transformer [csv] returned null, skip rest of pipeline execution [OETLPipeline][1:csv] DEBUG Transformer input: 0,10,First
[1:csv] DEBUG parsing=0,10,First
[1:csv] DEBUG document={id:0,postId:10,text:First}
[1:csv] DEBUG Transformer output: {id:0,postId:10,text:First}
[1:vertex] DEBUG Transformer input: {id:0,postId:10,text:First}
[1:vertex] DEBUG Transformer output: v(Comment)[#12:0]
[1:edge] DEBUG Transformer input: v(Comment)[#12:0]
[1:edge] DEBUG joinCurrentValue=10, lookupResult=Post#11:0{id:10,title:NoSQL movement} v1
Error in Pipeline execution: java.lang.NullPointerException
java.lang.NullPointerException
at com.orientechnologies.orient.etl.transformer.OEdgeTransformer.createEdge(OEdgeTransformer.java:186)
at com.orientechnologies.orient.etl.transformer.OEdgeTransformer.executeTransform(OEdgeTransformer.java:117)
at com.orientechnologies.orient.etl.transformer.OAbstractTransformer.transform(OAbstractTransformer.java:37)
at com.orientechnologies.orient.etl.OETLPipeline.execute(OETLPipeline.java:114)
at com.orientechnologies.orient.etl.OETLProcessor.executeSequentially(OETLProcessor.java:487)
at com.orientechnologies.orient.etl.OETLProcessor.execute(OETLProcessor.java:291)
at com.orientechnologies.orient.etl.OETLProcessor.main(OETLProcessor.java:161)
ETL process halted: com.orientechnologies.orient.etl.OETLProcessHaltedException: java.lang.NullPointerException
+ extracted 2 rows (0 rows/sec) - 2 rows -> loaded 0 vertices (0 vertices/sec) Total time: 1000ms [0 warnings, 1 errors]
+ extracted 2 rows (0 rows/sec) - 2 rows -> loaded 0 vertices (0 vertices/sec) Total time: 2s [0 warnings, 1 errors]
OS - Ubuntu 14.04 (x86_64)
java version "1.7.0_79"
OpenJDK Runtime Environment (IcedTea 2.5.6) (7u79-2.5.6-0ubuntu1.14.04.1)
OpenJDK 64-Bit Server VM (build 24.79-b02, mixed mode)
I've also tried with Oracle JVM .
Its looks like the EDGE's has not been created.
Do i need to add some MERGE transformer to overcome this problem?
Is there some error in documentation ?
Thanks,