Let's say I have 2 tables in MySQL:
table1 with {name_id,name} and table2 with {name_id,text_id,text}
Now I want to get them connected (name_id) in OrientDB.
One way would now be to import both tables as Class. That's easy and then create edges with the name_id. Everything is fine with that, but it would be much easier to generate edges with ETL if that is anyway possible. So I don't know what is more efficient. Someone else also said that Sails (https://github.com/vjsrinath/sails-orientdb) might be a good choice.
If ETL allows that I could imagine about the following way:
Of course this is very crazy if you imagine 30 tables or so. Was just an idea, just to check if that is already possible somehow.
Hey so I have now some experiences with ETL. I think this is great for import. That's why I want to improve the importing process now.
- First of all is it possible to run several imports parallel(not with several consoles) or if one is done start another instantly?
- How do I create an edge (https://github.com/orientechnologies/orientdb-etl/wiki/Transformer#edge is not helpful for me)
Let's say I have 2 tables in MySQL:
table1 with {name_id,name} and table2 with {name_id,text_id,text}
Now I want to get them connected (name_id) in OrientDB.
One way would now be to import both tables as Class. That's easy and then create edges with the name_id. Everything is fine with that, but it would be much easier to generate edges with ETL if that is anyway possible. So I don't know what is more efficient. Someone else also said that Sails (https://github.com/vjsrinath/sails-orientdb) might be a good choice.
If ETL allows that I could imagine about the following way:
- read line of table1 -> safe in memory
- look in table2 if name_id exists
- -> if yes, create vertex Tabel1 and Table2
- -> if no, create vertex Tabel1 and Table2 and create an edge
- and so on
Of course this is very crazy if you imagine 30 tables or so. Was just an idea, just to check if that is already possible somehow.
--
---
You received this message because you are subscribed to the Google Groups "OrientDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email to orient-databa...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
This is a great example Luca, thanks first of all.
But could you additionally add information about the MySQL schema and do I understand it correctly that you get the classes Person,Friend and an edge. But where comes the friend data?
edge: {
class: "hasPost",
joinFieldName: "person_id",
lookup: "person.id",
unresolvedLinkAction: "CREATE",
if: "person_id is not null"
}
Now we also create such classes in OrientDB. Now we tell OrientDB if there is INSERT INTO Person or Post -> create edge on "id" to "person_id". I don't but isn't that pretty simple for a database to do?
{ "edge": { "class": "Person", "
Exception in thread "main" java.lang.IllegalArgumentException: Type error. The class Person does not extend class 'E' and therefore cannot be considered an Edge
Exception in thread "main" java.lang.IllegalArgumentException: Property value ca
n not be null
at com.tinkerpop.blueprints.util.ExceptionFactory.propertyValueCanNotBeN
ull(ExceptionFactory.java:60)
at com.tinkerpop.blueprints.impls.orient.OrientElement.validateProperty(
OrientElement.java:423)
at com.tinkerpop.blueprints.impls.orient.OrientElement.setProperty(Orien
tElement.java:139)
at com.orientechnologies.orient.etl.transformer.OEdgeTransformer.execute
Transform(OEdgeTransformer.java:102)
at com.orientechnologies.orient.etl.transformer.OAbstractTransformer.tra
nsform(OAbstractTransformer.java:37)
at com.orientechnologies.orient.etl.OETLPipeline.execute(OETLPipeline.ja
va:97)
at com.orientechnologies.orient.etl.OETLProcessor.executeSequentially(OE
TLProcessor.java:459)
at com.orientechnologies.orient.etl.OETLProcessor.execute(OETLProcessor.
java:253)
at com.orientechnologies.orient.etl.OETLProcessor.main(OETLProcessor.jav
a:221)
+ extracted 1 records (0 records/sec) - 1 records -> loaded 0 vertices (0 vertic
es/sec) Total time: 1000ms [0 warnings, 0 errors]
+ extracted 1 records (0 records/sec) - 1 records -> loaded 0 vertices (0 vertic
es/sec) Total time: 2s [0 warnings, 0 errors]
{
"config": {
"verbose": true
},
"extractor" : {
"jdbc": { "driver": "com.mysql.jdbc.Driver",
"url": "jdbc:mysql://localhost/test",
"userName": "root",
"userPassword": "",
"query": "select * from person" }
},
"transformers" : [
{ "vertex": { "class": "Person"} }
],
"loader" : {
"orientdb": {
"dbURL": "plocal:D:\Eclipse LaTeX\DB - orientdb\databases\Test5",
"tx": true,
"batchCommit": 5000,
"wal" : true,
"dbType": "graph"
}
}
}
{
"config": {
"verbose": true
},
"extractor" : {
"jdbc": { "driver": "com.mysql.jdbc.Driver",
"url": "jdbc:mysql://localhost/test",
"userName": "root",
"userPassword": "",
"query": "select * from post" }
},
"transformers" : [
{ "vertex": { "class": "Post"} },
{ "edge": { "class": "Wrote", "direction" : "in",
"joinFieldName": "person_id",
"lookup":"Person.id", "unresolvedLinkAction":"CREATE"} }
],
"loader" : {
"orientdb": {
"dbURL": "plocal:D:\Eclipse LaTeX\DB - orientdb\databases\Test5",
"tx": true,
"batchCommit": 5000,
"wal" : true,
"dbType": "graph"
}
}
}
No problem Luca, but still the same problem. Here are my JSON's. Just in case I have something missing there. I braked it down to the things I really need:
Person ETL:
{
"config": {
"verbose": true
},
"extractor" : {
"jdbc": { "driver": "com.mysql.jdbc.Driver",
"url": "jdbc:mysql://localhost/test",
"userName": "root",
"userPassword": "",
"query": "select * from person" }
},
"transformers" : [
{ "vertex": { "class": "Person"} }
],
"loader" : {
"orientdb": {
"dbURL": "plocal:D:\Eclipse LaTeX\DB - orientdb\databases\Test5",
"tx": true,
"batchCommit": 5000,
"wal" : true,
"dbType": "graph"
}
}
}
Post and edge Wrote ETL:
{
"config": {
"verbose": true
},
"extractor" : {
"jdbc": { "driver": "com.mysql.jdbc.Driver",
"url": "jdbc:mysql://localhost/test",
"userName": "root",
"userPassword": "",
"query": "select * from post" }
},
"transformers" : [
{ "vertex": { "class": "Post"} },
{ "edge": { "class": "Wrote", "direction" : "in",
"joinFieldName": "person_id",
"lookup":"Person.id", "unresolvedLinkAction":"CREATE"} }
],
"loader" : {
"orientdb": {
"dbURL": "plocal:D:\Eclipse LaTeX\DB - orientdb\databases\Test5",
"tx": true,
"batchCommit": 5000,
"wal" : true,
"dbType": "graph"
}
}
}
And Luca, no the Edge problem was already fixed be meself =)
not it's this here take I can't handle to fix =/
Exception in thread "main" java.lang.IllegalArgumentException: Property value can not be null
{
"config": {
"verbose": true
},
"extractor" : {
"jdbc": { "driver": "com.mysql.jdbc.Driver",
"url": "jdbc:mysql://localhost/test",
"userName": "root",
"userPassword": "",
"query": "select * from Author" }
},
"transformers" : [
{ "vertex": { "class": "Author"} }
],
"loader" : {
"orientdb": {
"dbURL": "plocal:D:\Eclipse LaTeX\DB - orientdb\databases\Test6",
"dbAutoCreate": true
}
}
}
D:\Eclipse LaTeX\DB - orientdb\bin>oetl.bat backup\luca\Author.json
OrientDB etl v.1.7.8 (build @BUILD@) www.orientechnologies.com
BEGIN ETL PROCESSOR
ETL process halted: com.orientechnologies.orient.etl.OETLProcessHaltedException:
java.lang.NullPointerException
"dbType": "graph"
{
"config": {
"verbose": true
},
"extractor" : {
"jdbc": { "driver": "com.mysql.jdbc.Driver",
"url": "jdbc:mysql://localhost/test",
"userName": "root",
"userPassword": "",
"query": "select * from Author" }
},
"transformers" : [
{ log : { prefix: "BEFORE->" } },
{ "vertex": { "class": "Author"} },
{ log : { prefix: "AFTER->" } }
],
"loader" : {
"orientdb": {
dbURL: "plocal:C:\Users\kwoxer\Desktop\DB - orientdb\databases\Test",
dbUser: "root",
dbPassword: "root",
dbAutoDropIfExists: false,
dbAutoCreate: true,
tx: false,
wal: false,
batchCommit: 1000,
dbType: "graph",
indexes: [{class:"Author", fields:["id:string"], type:"UNIQUE_HASH_INDEX" }]
}
}
}
C:\Users\kwoxer\Desktop\DB - orientdb\bin>oetl.bat backup\luca\person.json
OrientDB etl v.1.7.8 (build @BUILD@) www.orientechnologies.com
BEGIN ETL PROCESSOR
+ extracted 0 records (0 records/sec) - 0 records -> loaded 0 vertices (0 vertic
es/sec) Total time: 1015ms [0 warnings, 0 errors]
+ extracted 0 records (0 records/sec) - 0 records -> loaded 0 vertices (0 vertic
es/sec) Total time: 2015ms [0 warnings, 0 errors]
+ extracted 0 records (0 records/sec) - 0 records -> loaded 0 vertices (0 vertic
es/sec) Total time: 3016ms [0 warnings, 0 errors]
+ extracted 0 records (0 records/sec) - 0 records -> loaded 0 vertices (0 vertic
es/sec) Total time: 4016ms [0 warnings, 0 errors]
BEFORE->{id:1,name:wda}
AFTER->v(Author)[#11:0]
BEFORE->{id:2,name:fwf}
AFTER->v(Author)[#11:1]
END ETL PROCESSOR
+ extracted 3 records (7 records/sec) - 3 records -> loaded 2 vertices (4 vertic
es/sec) Total time: 4427ms [0 warnings, 0 errors]
{
"config": {
"verbose": true
},
"extractor" : {
"jdbc": { "driver": "com.mysql.jdbc.Driver",
"url": "jdbc:mysql://localhost/test",
"userName": "root",
"userPassword": "",
"query": "select * from Post" }
},
"transformers" : [
{ log : { prefix: "LOG 1->" } },
{ "vertex": { "class": "Post"} },
{ log : { prefix: "LOG 2->" } },
{ "edge": { "class": "Wrote", "direction" : "in",
"joinFieldName": "person_id",
"lookup":"Author.id", "unresolvedLinkAction":"WARNING"} },
{ log : { prefix: "LOG 3->" } }
],
"loader" : {
"orientdb": {
dbURL: "plocal:C:\Users\kwoxer\Desktop\DB - orientdb\databases\Test",
dbUser: "root",
dbPassword: "root",
dbAutoDropIfExists: false,
dbAutoCreate: true,
tx: false,
wal: false,
batchCommit: 1000,
dbType: "graph",
indexes: [{class:"Post", fields:["person_id:string"], type:"UNIQUE_HASH_INDEX" }]
}
}
}
C:\Users\kwoxer\Desktop\DB - orientdb\bin>oetl.bat backup\luca\postedge.json
OrientDB etl v.1.7.8 (build @BUILD@) www.orientechnologies.com
BEGIN ETL PROCESSOR
+ extracted 0 records (0 records/sec) - 0 records -> loaded 0 vertices (0 vertic
es/sec) Total time: 1000ms [0 warnings, 0 errors]
+ extracted 0 records (0 records/sec) - 0 records -> loaded 0 vertices (0 vertic
es/sec) Total time: 2001ms [0 warnings, 0 errors]
+ extracted 0 records (0 records/sec) - 0 records -> loaded 0 vertices (0 vertic
es/sec) Total time: 3001ms [0 warnings, 0 errors]
+ extracted 0 records (0 records/sec) - 0 records -> loaded 0 vertices (0 vertic
es/sec) Total time: 4001ms [0 warnings, 0 errors]
+ extracted 0 records (0 records/sec) - 0 records -> loaded 0 vertices (0 vertic
es/sec) Total time: 5001ms [0 warnings, 0 errors]
LOG 1->{person_id:1,title:wadwd}
LOG 2->v(Post)[#12:0]
LOG 3->v(Post)[#12:0]
LOG 1->{person_id:2,title:fawf}
LOG 2->v(Post)[#12:1]
LOG 3->v(Post)[#12:1]
END ETL PROCESSOR
+ extracted 3 records (8 records/sec) - 3 records -> loaded 2 vertices (5 vertic
es/sec) Total time: 5356ms [0 warnings, 0 errors]
C:\Users\kwoxer\Desktop\DB - orientdb\bin>oetl.bat backup\luca\postedge.json
OrientDB etl v.1.7.8 (build @BUILD@) www.orientechnologies.com
BEGIN ETL PROCESSOR
+ extracted 0 records (0 records/sec) - 0 records -> loaded 0 vertices (0 vertic
es/sec) Total time: 1010ms [0 warnings, 0 errors]
+ extracted 0 records (0 records/sec) - 0 records -> loaded 0 vertices (0 vertic
es/sec) Total time: 2026ms [0 warnings, 0 errors]
+ extracted 0 records (0 records/sec) - 0 records -> loaded 0 vertices (0 vertic
es/sec) Total time: 3026ms [0 warnings, 0 errors]
+ extracted 0 records (0 records/sec) - 0 records -> loaded 0 vertices (0 vertic
es/sec) Total time: 4057ms [0 warnings, 0 errors]
+ extracted 0 records (0 records/sec) - 0 records -> loaded 0 vertices (0 vertic
es/sec) Total time: 5058ms [0 warnings, 0 errors]
LOG 1->{person_id:1,title:wadwd}
LOG 2->v(Post)[#12:0]
edge->edge: WARN Cannot resolve join for value 'null'
LOG 3->v(Post)[#12:0]
LOG 1->{person_id:2,title:fawf}
LOG 2->v(Post)[#12:1]
edge->edge: WARN Cannot resolve join for value 'null'
LOG 3->v(Post)[#12:1]
END ETL PROCESSOR
+ extracted 3 records (11 records/sec) - 3 records -> loaded 2 vertices (7 verti
ces/sec) Total time: 5328ms [2 warnings, 0 errors]
Switching from Person to Author was just to test your Tutorial as exactly as possible. I now added some logs. There you can see that there is no warning but also no edge is created:
Person ETL:
{
"config": {
"verbose": true
},
"extractor" : {
"jdbc": { "driver": "com.mysql.jdbc.Driver",
"url": "jdbc:mysql://localhost/test",
"userName": "root",
"userPassword": "",
"query": "select * from Author" }
},
"transformers" : [
{ log : { prefix: "BEFORE->" } },
{ "vertex": { "class": "Author"} },
{ log : { prefix: "AFTER->" } }
],
"loader" : {
"orientdb": {
dbURL: "plocal:C:\Users\kwoxer\Desktop\DB - orientdb\databases\Test",
dbUser: "root",
dbPassword: "root",
dbAutoDropIfExists: false,
dbAutoCreate: true,
tx: false,
wal: false,
batchCommit: 1000,
dbType: "graph",
indexes: [{class:"Author", fields:["id:string"], type:"UNIQUE_HASH_INDEX" }]
}
}
}
The results in command line:
C:\Users\kwoxer\Desktop\DB - orientdb\bin>oetl.bat backup\luca\person.json
OrientDB etl v.1.7.8 (build @BUILD@) www.orientechnologies.com
BEGIN ETL PROCESSOR
+ extracted 0 records (0 records/sec) - 0 records -> loaded 0 vertices (0 vertic
es/sec) Total time: 1015ms [0 warnings, 0 errors]
+ extracted 0 records (0 records/sec) - 0 records -> loaded 0 vertices (0 vertic
es/sec) Total time: 2015ms [0 warnings, 0 errors]
+ extracted 0 records (0 records/sec) - 0 records -> loaded 0 vertices (0 vertic
es/sec) Total time: 3016ms [0 warnings, 0 errors]
+ extracted 0 records (0 records/sec) - 0 records -> loaded 0 vertices (0 vertic
es/sec) Total time: 4016ms [0 warnings, 0 errors]
BEFORE->{id:1,name:wda}
AFTER->v(Author)[#11:0]
BEFORE->{id:2,name:fwf}
AFTER->v(Author)[#11:1]
END ETL PROCESSOR
+ extracted 3 records (7 records/sec) - 3 records -> loaded 2 vertices (4 vertic
es/sec) Total time: 4427ms [0 warnings, 0 errors]
Post/Edge ETL:
{
"config": {
"verbose": true
},
"extractor" : {
"jdbc": { "driver": "com.mysql.jdbc.Driver",
"url": "jdbc:mysql://localhost/test",
"userName": "root",
"userPassword": "",
"query": "select * from Post" }
},
"transformers" : [
{ log : { prefix: "LOG 1->" } },
{ "vertex": { "class": "Post"} },
{ log : { prefix: "LOG 2->" } },
{ "edge": { "class": "Wrote", "direction" : "in",
"joinFieldName": "person_id",
"lookup":"Author.id", "unresolvedLinkAction":"WARNING"} },
{ log : { prefix: "LOG 3->" } }
],
"loader" : {
"orientdb": {
dbURL: "plocal:C:\Users\kwoxer\Desktop\DB - orientdb\databases\Test",
dbUser: "root",
dbPassword: "root",
dbAutoDropIfExists: false,
dbAutoCreate: true,
tx: false,
wal: false,
batchCommit: 1000,
dbType: "graph",
indexes: [{class:"Post", fields:["person_id:string"], type:"UNIQUE_HASH_INDEX" }]
}
}
}
Here the command line output:
C:\Users\kwoxer\Desktop\DB - orientdb\bin>oetl.bat backup\luca\postedge.json
OrientDB etl v.1.7.8 (build @BUILD@) www.orientechnologies.com
BEGIN ETL PROCESSOR
+ extracted 0 records (0 records/sec) - 0 records -> loaded 0 vertices (0 vertic
es/sec) Total time: 1000ms [0 warnings, 0 errors]
+ extracted 0 records (0 records/sec) - 0 records -> loaded 0 vertices (0 vertic
es/sec) Total time: 2001ms [0 warnings, 0 errors]
+ extracted 0 records (0 records/sec) - 0 records -> loaded 0 vertices (0 vertic
es/sec) Total time: 3001ms [0 warnings, 0 errors]
+ extracted 0 records (0 records/sec) - 0 records -> loaded 0 vertices (0 vertic
es/sec) Total time: 4001ms [0 warnings, 0 errors]
+ extracted 0 records (0 records/sec) - 0 records -> loaded 0 vertices (0 vertic
es/sec) Total time: 5001ms [0 warnings, 0 errors]
LOG 1->{person_id:1,title:wadwd}
LOG 2->v(Post)[#12:0]
LOG 3->v(Post)[#12:0]
LOG 1->{person_id:2,title:fawf}
LOG 2->v(Post)[#12:1]
LOG 3->v(Post)[#12:1]
END ETL PROCESSOR
+ extracted 3 records (8 records/sec) - 3 records -> loaded 2 vertices (5 vertic
es/sec) Total time: 5356ms [0 warnings, 0 errors]
I don't know why it is working for you. Did you already try one ETL of mine? Maybe you have some other config? Maybe something "oetl.bat" is n...
--
...
LOG 2->v(Post)[<span
--
{
"config": {
"log": "debug"
},
"extractor" : {
"jdbc": { "driver": "com.mysql.jdbc.Driver",
"url": "jdbc:mysql://localhost/test",
"userName": "root",
"userPassword": "",
"query": "select * from Author" }
},
"transformers" : [
{ log : { prefix: "BEFORE->" } },
{ "vertex": { "class": "Author"} },
{ log : { prefix: "AFTER->" } }
],
"loader" : {
"orientdb": {
"dbURL": "plocal:D:\Eclipse LaTeX\DB - orientdb\databases\Test6",
dbUser: "root",
dbPassword: "root",
dbAutoDropIfExists: false,
dbAutoCreate: true,
tx: false,
wal: false,
batchCommit: 1000,
dbType: "graph",
indexes: [{class:"Author", fields:["id:string"], type:"UNIQUE_HASH_INDEX" }]
}
}
}
D:\Eclipse LaTeX\DB - orientdb\bin>oetl.bat backup\luca\Author.json
OrientDB etl v.1.7.8 (build @BUILD@) www.orientechnologies.com
BEGIN
ETL PROCESSOR
BEFORE->{id:1,name:asdd}
AFTER->v(Author)[#11:0]
BEFORE->{id:2,name:aasdasd}
AFTER->v(Author)[#11:1]
END ETL PROCESSOR
+ extracted 3 records (29 records/sec) - 3 records -> loaded 2 vertices (19 vert
ices/sec) Total time: 3103ms [0 warnings, 0 errors]
{
"config": {
"log": "debug"
},
"extractor" : {
"jdbc": { "driver": "com.mysql.jdbc.Driver",
"url": "jdbc:mysql://localhost/test",
"userName": "root",
"userPassword": "",
"query": "select * from Post" }
},
"transformers" : [
{ log : { prefix: "BEFORE->" } },
{ "vertex": { "class": "Post"} },
{ log : { prefix: "MIDDLE->" } },
{ "edge": { "class": "Wrote", "direction" : "in",
"joinFieldName": "author_id",
"lookup":"Author.id", "unresolvedLinkAction":"WARNING"} },
{ log : { prefix: "AFTER->" } }
],
"loader" : {
"orientdb": {
"dbURL": "plocal:D:\Eclipse LaTeX\DB - orientdb\databases\Test6",
dbUser: "root",
dbPassword: "root",
dbAutoDropIfExists: false,
dbAutoCreate: true,
tx: false,
wal: false,
batchCommit: 1000,
dbType: "graph",
indexes: [{class:"Post", fields:["id:string"], type:"UNIQUE_HASH_INDEX" }]
}
}
}
D:\Eclipse LaTeX\DB - orientdb\bin>oetl.bat backup\luca\Post.json
OrientDB etl v.1.7.8 (build @BUILD@) www.orientechnologies.com
BEGIN
ETL PROCESSOR
BEFORE->{title:jop es klappt,author_id:1,text:wdwd}
MIDDLE->v(Post)[#13:0]
AFTER->v(Post)[#13:0]
BEFORE->{title:aaaa,author_id:2,text:awfwaf}
MIDDLE->v(Post)[#13:1]
AFTER->v(Post)[#13:1]
END ETL PROCESSOR
+ extracted 3 records (0 records/sec) - 3 records -> loaded 2 vertices (0 vertic
es/sec) Total time: 947ms [0 warnings, 0 errors]
...
OrientDB etl v.1.7.8 (build @BUILD@) www<span style="color: #660;" class="styled
C:\Users\Mr. Kox\Desktop\orientdb-develop\releases\orientdb-community-2.0-SNAPSH
OT\bin>oetl.bat backup\luca\Author.json
OrientDB etl v.2.0-SNAPSHOT (build @BUILD@) www.orientechnologies.com
Exception in thread "main" com.orientechnologies.orient.core.exception.OConfigur
ationException: Error on creating ETL processor
at com.orientechnologies.orient.etl.OETLProcessor.<init>(OETLProcessor.j
ava:163)
at com.orientechnologies.orient.etl.OETLProcessor.main(OETLProcessor.jav
a:220)
Caused by: com.orientechnologies.orient.core.exception.ODatabaseException: Canno
t create database
at com.orientechnologies.orient.core.db.record.ODatabaseRecordAbstract.c
reate(ODatabaseRecordAbstract.java:418)
at com.orientechnologies.orient.core.db.ODatabaseWrapperAbstract.create(
ODatabaseWrapperAbstract.java:61)
at com.orientechnologies.orient.core.db.ODatabaseRecordWrapperAbstract.c
reate(ODatabaseRecordWrapperAbstract.java:70)
at com.orientechnologies.orient.core.db.ODatabaseWrapperAbstract.create(
ODatabaseWrapperAbstract.java:56)
at com.orientechnologies.orient.core.db.ODatabaseRecordWrapperAbstract.c
reate(ODatabaseRecordWrapperAbstract.java:64)
at com.tinkerpop.blueprints.impls.orient.OrientGraphFactory.getDatabase(
OrientGraphFactory.java:139)
at com.tinkerpop.blueprints.impls.orient.OrientGraphFactory.getDatabase(
OrientGraphFactory.java:118)
at com.tinkerpop.blueprints.impls.orient.OrientGraphFactory.getNoTx(Orie
ntGraphFactory.java:102)
at com.tinkerpop.blueprints.impls.orient.OrientGraphFactory.get(OrientGr
aphFactory.java:78)
at com.orientechnologies.orient.etl.loader.OOrientDBLoader.configure(OOr
ientDBLoader.java:185)
at com.orientechnologies.orient.etl.OETLProcessor.configureComponent(OET
LProcessor.java:470)
at com.orientechnologies.orient.etl.OETLProcessor.<init>(OETLProcessor.j
ava:136)
... 1 more
Caused by: com.orientechnologies.orient.core.exception.ODatabaseException: Canno
t create database
at com.orientechnologies.orient.core.db.raw.ODatabaseRaw.create(ODatabas
eRaw.java:150)
at com.orientechnologies.orient.core.db.ODatabaseWrapperAbstract.create(
ODatabaseWrapperAbstract.java:61)
at com.orientechnologies.orient.core.db.record.ODatabaseRecordAbstract.c
reate(ODatabaseRecordAbstract.java:369)
... 12 more
Caused by: java.lang.IllegalStateException: Location passed in WAL does not exis
t, or IO error was happened. DB can not work in durable mode in such case.
at com.orientechnologies.orient.core.storage.impl.local.paginated.wal.OD
iskWriteAheadLog.<init>(ODiskWriteAheadLog.java:609)
at com.orientechnologies.orient.core.storage.impl.local.paginated.wal.OD
iskWriteAheadLog.<init>(ODiskWriteAheadLog.java:585)
at com.orientechnologies.orient.core.storage.impl.local.paginated.OLocal
PaginatedStorage.initWalAndDiskCache(OLocalPaginatedStorage.java:305)
at com.orientechnologies.orient.core.storage.impl.local.OAbstractPaginat
edStorage.create(OAbstractPaginatedStorage.java:218)
at com.orientechnologies.orient.core.storage.impl.local.paginated.OLocal
PaginatedStorage.create(OLocalPaginatedStorage.java:97)
at com.orientechnologies.orient.core.db.raw.ODatabaseRaw.create(ODatabas
eRaw.java:146)
... 14 more
D:\Eclipse LaTeX\DB - orientdb\orientdb-community-2.0-SNAPSHOT\bin>oetl.bat back
up\luca\Author.json
OrientDB etl v.2.0-SNAPSHOT (build @BUILD@) www.orientechnologies.com
BEGIN ETL PROCESSOR
BEFORE->{id:1,name:asdd}
AFTER->v(Author)[#11:0]
BEFORE->{id:2,name:aasdasd}
AFTER->v(Author)[#11:1]
END ETL PROCESSOR
+ extracted 3 records (3 records/sec) - 3 records -> loaded 2 vertices (2 vertic
es/sec) Total time: 1824ms [0 warnings, 0 errors]
D:\Eclipse LaTeX\DB - orientdb\orientdb-community-2.0-SNAPSHOT\bin>oetl.bat back
up\luca\Post.json
OrientDB etl v.2.0-SNAPSHOT (build @BUILD@) www.orientechnologies.com
BEGIN ETL PROCESSOR
BEFORE->{title:jop es klappt,author_id:1,text:wdwd}
MIDDLE->v(Post)[#12:0]
AFTER->v(Post)[#12:0]
BEFORE->{title:aaaa,author_id:2,text:awfwaf}
MIDDLE->v(Post)[#12:1]
AFTER->v(Post)[#12:1]
END ETL PROCESSOR
+ extracted 3 records (4 records/sec) - 3 records -> loaded 2 vertices (3 vertic
es/sec) Total time: 2615ms [0 warnings, 0 errors]
Totally forgot that it is a complete other config. For sure. Now it's working in the studio.
I again tried the ETL script but still having this here:
D:\Eclipse LaTeX\DB - orientdb\orientdb-community-2.0-SNAPSHOT\bin>oetl.bat back
up\luca\Author.json
Am Donnerstag, 28. August 2014 16:59:58 UTC+2 schrieb Lvc@:
D:\Eclipse LaTeX\DB - orientdb\orientdb-community-2.0-SNAPSHOT\bin>oetl.bat back
up\luca\Author.json
OrientDB etl v.2.0-SNAPSHOT (build @BUILD@) www.orientechnologies.com
BEGIN ETL PROCESSOR
[orientdb] DEBUG - OrientDBLoader: created vertex class 'Author'
[orientdb] DEBUG - OrientDBLoader: created property 'Author.id' of type: string
+ extracted 0 records (0 records/sec) - 0 records -> loaded 0 vertices (0 vertic
es/sec) Total time: 1000ms [0 warnings, 0 errors]
[orientdb] DEBUG - OrientDocumentLoader: created index 'Author.id' type 'UNIQUE_
HASH_INDEX' against Class 'Author', fields [id:string]
BEFORE->{id:1,name:asdd}
AFTER->v(Author)[#11:0]
BEFORE->{id:2,name:aasdasd}
AFTER->v(Author)[#11:1]
END ETL PROCESSOR
+ extracted 5 records (8 records/sec) - 5 records -> loaded 2 vertices (3 vertic
es/sec) Total time: 1565ms [0 warnings, 0 errors]
D:\Eclipse LaTeX\DB - orientdb\orientdb-community-2.0-SNAPSHOT\bin>oetl.
bat back
up\luca\Post.json
OrientDB etl v.2.0-SNAPSHOT (build @BUILD@) www.orientechnologies.com
BEGIN ETL PROCESSOR
[orientdb] DEBUG - OrientDBLoader: created vertex class 'Post'
[orientdb] DEBUG - OrientDBLoader: created property 'Post.id' of type: string
+ extracted 0 records (0 records/sec) - 0 records -> loaded 0 vertices (0 vertic
es/sec) Total time: 1000ms [0 warnings, 0 errors]
[orientdb] DEBUG - OrientDocumentLoader: created index 'Post.id' type 'UNIQUE_HA
SH_INDEX' against Class 'Post', fields [id:string]
+ extracted 0 records (0 records/sec) - 0 records -> loaded 0 vertices (0 vertic
es/sec) Total time: 2s [0 warnings, 0 errors]
BEFORE->{title:jop es klappt,author_id:1,text:wdwd}
MIDDLE->v(Post)[#12:0]
[1:edge] DEBUG joinValue=1, lookupResult=Author#11:0{id:1,name:asdd} v1
AFTER->v(Post)[#12:0]
BEFORE->{title:aaaa,author_id:2,text:awfwaf}
MIDDLE->v(Post)[#12:1]
[3:edge] DEBUG joinValue=2, lookupResult=Author#11:1{id:2,name:aasdasd} v1
AFTER->v(Post)[#12:1]
END ETL PROCESSOR
+ extracted 5 records (68 records/sec) - 5 records -> loaded 2 vertices (27 vert
ices/sec) Total time: 2073ms [0 warnings, 0 errors]
...
--
...
--
Curtis,You could create 2 or more etl scripts, some that extract vertices and other that extract edges.Lvc@ᐧOn 25 August 2014 12:25, 'Curtis Mosters' via OrientDB <orient-...@googlegroups.com> wrote:
Hi Luca, well your example is just reading one table from MySQL. One table with creating edges on it's entries. But in the usual cases that's not the way how to import from a MySQL. Or maybe I just didn't understood that example completely. But so far as I have seen it, you used one table from MySQL that contained {id,...,friend_id}. You created profiles on that id and then created edge on that id's. Is that right?
But just once again I have those data as usually stored in another table. So that cannot work for me.
Am Donnerstag, 21. August 2014 15:56:05 UTC+2 schrieb Lvc@:ᐧOn 21 August 2014 14:45, 'Curtis Mosters' via OrientDB <orient-...@googlegroups.com> wrote:
This is a great example Luca, thanks first of all.
But could you additionally add information about the MySQL schema and do I understand it correctly that you get the classes Person,Friend and an edge. But where comes the friend data?Friend in my case is an Edge class. (create class Friend extends E). It's useful to create ad-hoc edge classes instead that the generic "E":Lvc@
Am Donnerstag, 21. August 2014 13:25:47 UTC+2 schrieb Lvc@:Hi Curtis,ETL is very powerful and we're improving it everyday with users' feedback. We want to let it to be final for 2.0, so we can bundle with it. By the way Enterprise Edition will have a Web Interface to edit it, and in the future also to debug it.Unfortunately I don't understand in your example table1 & 2 with both name_id field. Look at this example about Friendship. I want to connect a social network like app.This is an example of ETL configuration. My comments begins with // but remove them from real config file:{config: {verbose: true},begin: [],extractor: {"jdbc": { "driver": "com.mysql.jdbc.Driver",
"url": "jdbc:mysql://localhost/mysocialnetwork",
"userName": "root",
"userPassword": "root",
"query": "select * from profile"
}},transformers : [{// THIS IS ONLY A LOG, USEFUL TO TRACE WHAT ARRIVES FROM MYSQLlog: {prefix: "MySQL -> "}},{merge: {// LOOKUP BY ID: IF ALREADY PRESENT MERGE THE FIELDS BY OVERWRITING THE DIFFERENT ONESjoinFieldName: "id",lookup: "Profile.id"}},{vertex: {// TRANSFORM IT IN A VERTEXclass: "Profile"}},{edge: {// CONNECT THE FRIEND IN MYSQL COLUMN 'friend_id'class: "Friend", // Friend is the edges' classjoinFieldName: "friend_id", //lookup: "Profile.id",unresolvedLinkAction: "CREATE", // IF DOESN'T EXIST YET, CREATE THE VERTEX EMPTY. WILL BE FURTHER UPDATEDif: "friend_id is not null"}},{log: {prefix: "Vertex -> "}}],loader : {orientdb: {dbURL: "remote:localhost/yourdb",dbUser: "admin",dbPassword: "admin",dbAutoCreate: true,tx: true,batchCommit: 1000,dbType: "graph",classes: [],indexes: []}}}Lvc@On 21 August 2014 13:05, 'Curtis Mosters' via OrientDB <orient-...@googlegroups.com> wrote:
Hey so I have now some experiences with ETL. I think this is great for import. That's why I want to improve the importing process now.
- First of all is it possible to run several imports parallel(not with several consoles) or if one is done start another instantly?
- How do I create an edge (https://github.com/orientechnologies/orientdb-etl/wiki/Transformer#edge is not helpful for me)
Let's say I have 2 tables in MySQL:
table1 with {name_id,name} and table2 with {name_id,text_id,text}
Now I want to get them connected (name_id) in OrientDB.
One way would now be to import both tables as Class. That's easy and then create edges with the name_id. Everything is fine with that, but it would be much easier to generate edges with ETL if that is anyway possible. So I don't know what is more efficient. Someone else also said that Sails (https://github.com/vjsrinath/sails-orientdb) might be a good choice.
If ETL allows that I could imagine about the following way:
- read line of table1 -> safe in memory
- look in table2 if name_id exists
- -> if yes, create vertex Tabel1 and Table2
- -> if no, create vertex Tabel1 and Table2 and create an edge
- and so on
Of course this is very crazy if you imagine 30 tables or so. Was just an idea, just to check if that is already possible somehow.
--To unsubscribe from this group and stop receiving emails from it, send an email to orient-databa...@googlegroups.com.
---
You received this message because you are subscribed to the Google Groups "OrientDB" group.
--
---
You received this message because you are subscribed to the Google Groups "OrientDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email to orient-databa...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.