Orientdb-ETL One to many relationship isnt working

57 views
Skip to first unread message

Hrishikesh Khanapure

unread,
Jan 4, 2016, 10:29:52 AM1/4/16
to OrientDB
Hi,

I am trying to import below two csvs

1.Subject csv:
id,subject
10,Maths

ETL config json for Subject

{

  "source": { "file": { "path": "/temp/test/subject.csv" } },

  "extractor": { "row": {} },

  "transformers": [

    { "csv": {} },

    { "vertex": { "class": "Subject" } }

  ],

  "loader": {

    "orientdb": {

       "dbURL": "plocal:/temp/databases/test",

       "dbType": "graph",

       "dbUser":"root",

       "dbPassword":"test123"

    }

  }

}



2.Topic csv:id,postId,text
0,10,Relation
1,10,Function
ETL config json for topic:

{

  "source": { "file": { "path": "/temp/test/topic.csv" } },

  "extractor": { "row": {} },

  "transformers": [

    { "csv": {} },

    { "vertex": { "class": "Topic" } },

    { "edge": { "class": "HasTopic",

                "joinFieldName": "subjectId",

                "lookup": "Subject.id",

                "direction": "in"

            }

        }

  ],

  "loader": {

    "orientdb": {

       "dbURL": "plocal:/temp/databases/test",

       "dbType": "graph",

       "dbUser":"root",

       "dbPassword":"test123"

    }

  }


I am able to import those two csv .
Maths should be linked to Relation and Function but Relation is only linked to Maths not to Function.

like this
Maths - > Relation two vertices are linked
but Maths - > Function are not linked.

Need help on this.


alessand...@gmail.com

unread,
Jan 4, 2016, 11:41:32 AM1/4/16
to OrientDB
Hi,
I have replaced in ETL config json for topic
"joinFieldName": "subjectId" with "joinFieldName": "postId"


Hrishikesh Khanapure

unread,
Jan 5, 2016, 7:31:36 AM1/5/16
to OrientDB
Hi,

But I'm now getting this exception while importing topic csv








BEGIN ETL PROCESSOR


Error in Pipeline execution: java.lang.NullPointerException


java.lang.NullPointerException


        at com.orientechnologies.orient.etl.transformer.OEdgeTransformer.createEdge(OEdgeTransformer.java:190)


        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



alessand...@gmail.com

unread,
Jan 5, 2016, 8:33:57 AM1/5/16
to OrientDB
To import subject and topic csv, you put the file subject.json and topic.json into the folder "bin" of your version of OrientDb.
After from the terminal, from the folder "bin" you give the following commands 
oetl.bat subject.json 
and 
oetl.bat topic.json


Alessandro
Reply all
Reply to author
Forward
0 new messages