Search code examples
graphimportorientdbvertices

orientdb SEVER Error during extraction: java.lang.IllegalArgumentException: Field name is empty


I have this file that I'm trying to import on orientdb it has the following structure :

    p1  p2  combined_score
1   568703.LGG_00001    568703.LGG_01682    282
2   568703.LGG_00001    568703.LGG_01831    183
3   568703.LGG_00001    568703.LGG_01491    238

I'm doing the import using oetl :

{
  "source": { "file": { "path": "C:/Users/Desktop/files/file22/lac2.csv" } },
  "extractor": { "csv": {} },
  "transformers": [
    { "vertex": { "class": "nodes" } }
  ],
  "loader": {
    "orientdb": {

       "dbURL": "plocal:/tmp/databases/db/db",
       "dbType": "graph",
       "classes": [
         {"name": "nodes", "extends": "V"},


       ]
    }
  }
}

Trying to import the vertices first and then the nodes . Yet I'm getting this error

2017-06-26 18:38:27:059 SEVER Error during extraction: java.lang.IllegalArgumentException: Field name is empty [OETLProcessor$OETLExtractorWorker]+ extracted 0 rows (0 rows/sec) - 0 rows -> loaded 0 vertices (0 vertices/sec) Total time: 2012ms [0 warnings, 0 errors]
+ extracted 0 rows (0 rows/sec) - 0 rows -> loaded 0 vertices (0 vertices/sec) Total time: 3033ms [0 warnings, 0 errors]
+ extracted 0 rows (0 rows/sec) - 0 rows -> loaded 0 vertices (0 vertices/sec) Total time: 4033ms [0 warnings, 0 errors]

Nothing is loading ,How can I solve this ?

I'm using orientdb community-2.2.18 and tried 2.2.22 vrsion too and the problem is percisting


Solution

  • This message:

    2017-06-26 18:38:27:059 SEVER Error during extraction: java.lang.IllegalArgumentException: Field name is empty
    

    is because in your csv file, the name of the property in blank, you can modify your csv file in this way without giving it a name:

    p1,p2,combined_score
    1,568703.LGG_00001,568703.LGG_01682,282
    2,568703.LGG_00001,568703.LGG_01831,183
    3,568703.LGG_00001,568703.LGG_01491,238
    

    and this will be your output:

    +----+-----+------+----+----------------+----------------+
    |#   |@RID |@CLASS|p1  |combined_score  |p2              |
    +----+-----+------+----+----------------+----------------+
    |0   |#17:0|nodes |1   |568703.LGG_01682|568703.LGG_00001|
    |1   |#18:0|nodes |2   |568703.LGG_01831|568703.LGG_00001|
    |2   |#19:0|nodes |3   |568703.LGG_01491|568703.LGG_00001|
    +----+-----+------+----+----------------+----------------+
    

    otherwise, if you wanna give it a name, do it in this way:

    id,p1,p2,combined_score
    1,568703.LGG_00001,568703.LGG_01682,282
    2,568703.LGG_00001,568703.LGG_01831,183
    3,568703.LGG_00001,568703.LGG_01491,238
    

    and this will be the output:

    +----+-----+------+----------------+--------------+----------------+----+
    |#   |@RID |@CLASS|p1              |combined_score|p2              |id  |
    +----+-----+------+----------------+--------------+----------------+----+
    |0   |#17:0|nodes |568703.LGG_00001|282           |568703.LGG_01682|1   |
    |1   |#18:0|nodes |568703.LGG_00001|183           |568703.LGG_01831|2   |
    |2   |#19:0|nodes |568703.LGG_00001|238           |568703.LGG_01491|3   |
    +----+-----+------+----------------+--------------+----------------+----+
    

    I tried with 2.2.22.

    Hope it helps.

    Regards