orientdb SEVER提取期间出错:java.lang.IllegalArgumentException:字段名称为空

时间:2017-06-26 18:47:07

标签: graph import orientdb vertices

我有这个文件,我试图在orientdb上导入它具有以下结构:

    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

我正在使用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"},


       ]
    }
  }
}

首先尝试导入顶点,然后尝试导入节点。 但是我收到了这个错误

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]

什么都没有加载,我该如何解决?

我正在使用orientdb社区-2.2.18并且尝试了2.2.22版本而且问题是存在的

1 个答案:

答案 0 :(得分:2)

此消息:

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

是因为在你的csv文件中,属性的名称是空白的,你可以用这种方式修改你的csv文件而不给它起一个名字:

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

这将是你的输出:

+----+-----+------+----+----------------+----------------+
|#   |@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|
+----+-----+------+----+----------------+----------------+

否则,如果你想给它一个名字,那就这样做:

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

这将是输出:

+----+-----+------+----------------+--------------+----------------+----+
|#   |@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   |
+----+-----+------+----------------+--------------+----------------+----+

我试过2.2.22。

希望它有所帮助。

此致