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 also interesting: if I change the "joinFieldName" to something that
is not in MySQL I see that he is actually doing something with edges. Here
is the command line output I get then:
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]
Am Montag, 25. August 2014 22:59:58 UTC+2 schrieb Lvc@:
>
> Hi Curtis,
>
> I don't know why you change from Person to Author, maybe this is the
> problem?
>
> However, use last release 0.9.2-SNAPSHOT. About the loader you can setup
> more params. For example it's important for performance reason that you set
> an index against Person.id. I've added also a log before and after
> transformation. Try running the following:
>
> {
> "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:D:\Eclipse LaTeX\DB - orientdb\databases\Test6",
> dbUser: "admin",
> dbPassword: "admin",
> dbAutoDropIfExists: false,
> dbAutoCreate: true,
> tx: false,
> wal: false,
> batchCommit: 1000,
> dbType: "graph",
> indexes: [{class:"Person", fields:["id:string"],
> type:"UNIQUE_HASH_INDEX" }]
> }
> }
> }
>
> Lvc@
>
> ᐧ
>
>
> On 25 August 2014 22:45, 'Curtis Mosters' via OrientDB <
> [email protected] <javascript:>> wrote:
>
>> Alright I just want to give an update. So I have the Author ETL:
>>
>> {
>> "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
>> }
>> }
>> }
>>
>> The database does not exist. Maybe that's the reason why it's not working
>> for me. I always runned my example with an existing database. I dunno. But
>> here is the error I get when running that JSON:
>>
>> 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
>>
>> And just when I add:
>>
>> "dbType": "graph"
>>
>> to the "loader" I get it running. Is that right, but why is that working
>> for you Lucan and not for me? =/
>>
>>
>>
>> --
>>
>> ---
>> 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 [email protected] <javascript:>.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
--
---
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 [email protected].
For more options, visit https://groups.google.com/d/optout.