Getting Error in Pipeline execution: java.lang.NullPointerException when creating edge

79 views
Skip to first unread message

Sam

unread,
Aug 15, 2015, 10:19:45 AM8/15/15
to orient-...@googlegroups.com
Why is the oetl throwing above exception. I am trying to create an edge between 2 imported classes from mysql. Everything seems to be ok. Here is my oetl: versin ss 2.1

{
  "config": {
    "log": "debug"
  },
  "extractor" : {
    "jdbc": { "driver": "com.mysql.jdbc.Driver",
              "url": "jdbc:mysql://localhost/dss",
              "userName": "root",
              "userPassword": "welcome101",
              "query": "select * from activity_log" }
  },
  "transformers" : [
  
   { "edge": { "class": "activity_entity_details", "direction" : "out", 
            "joinFieldName": "entityType",
            "lookup":"entity_tree.id", "unresolvedLinkAction":"WARNING"} }
  ],
  "loader" : {
   "orientdb": {
    "dbURL": "plocal:../databases/dss",
"dbAutoCreate": true,
"dbType": "graph"
    }
  }

The edges are not being created. Any clues why it is throwing a npe?

Giulia Brignoli

unread,
Aug 17, 2015, 5:12:47 AM8/17/15
to OrientDB
Hi Sam,

I think it's because you haven't created a vertex and then when you try to create the edge generates an NullPointerException.

Try to look this:

Regards,
Giulia

Saurabh Jain

unread,
Aug 17, 2015, 6:54:59 AM8/17/15
to orient-...@googlegroups.com
Hi Giulia

I already created the vertex. Can't I import only edges?
There must be a way to instantiate existing vertices of a class...in my case I imported activity_log separately so it is already there in orientdb....
{
  "config": {
    "log": "debug"
  },
  "extractor" : {
    "jdbc": { "driver": "com.mysql.jdbc.Driver",
              "url": "jdbc:mysql://localhost/dss",
              "userName": "root",
              "userPassword": "welcome101",
              "query": "select * from activity_log" }
  },
  "transformers" : [
   { "vertex": { "class": "activity_log"} }
  ],
  "loader" : {
    "orientdb": {
      "dbURL": "plocal:../databases/dss",
"dbAutoCreate": true,
"dbType": "graph"
    }
  }
}


 I need to import 25 tables with multiple edges between them, It will become tough to create one single json to import if I have to import edges and vertices together. What do u suggest?

Thanks
Sam

--

---
You received this message because you are subscribed to a topic in the Google Groups "OrientDB" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/orient-database/i_w3sVje64U/unsubscribe.
To unsubscribe from this group and all its topics, send an email to orient-databa...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Giulia Brignoli

unread,
Aug 17, 2015, 7:59:21 AM8/17/15
to OrientDB
Hi Sam,

I don't think you can import only the edge without creating any class. The only thing I can think of that you can do is create both the vertex and the edges all the same JSON.

Regards,
Giulia

Saurabh Jain

unread,
Aug 17, 2015, 9:13:03 AM8/17/15
to orient-...@googlegroups.com
HI Giulia

I have 25 tables and more than 20+ edges..all tables are interrelated in some way...it will be reallly tough to import all in one go. The json will be really complex. Are you sure there is no way to split import for large schema like ours? 
Also, one more issue...the lookup field is not scanning the whole table...it stays at current record..if the match is at the same or previous record it returns null...how do I make full table scan...do I have to use an index mandatorily for lookup field? Currently I am using a property.

--
Reply all
Reply to author
Forward
0 new messages