Orientdb csv导入丢失的数据

时间:2016-05-11 13:52:01

标签: csv etl orientdb

我正在尝试将一些csv数据加载到Orientdb。

OrientDb在c:/oreientdb/orientdb-community-2.1.15的Windows上安装。我正在使用下面的etl文件:

{
  "source": { "file": { "path": "f:/MOH/datamodel/audititem.txt" } },
  "extractor": { "csv": {}},
  "transformers": [
    { "vertex": { "class": "AuditIssue" } }
  ],
  "loader": {
    "orientdb": {
       "dbURL": "plocal:/orientdb/orientdb-community-2.1.15/databases/'MOH v1.0'",
       "dbType": "graph",
       "classes": [
         {"name": "AuditIssue", "extends": "V"},
       ], "indexes": []
   }
  }
}

当我通过oetl实用程序运行时,我没有错误

OrientDB etl v.2.1.15 (build 2.1.x@r243c566d47d8877ea0075b8f61abc8880f810a42; 2016-04-04 12:07:47+0000) www.orientdb.com
BEGIN ETL PROCESSOR
[file] INFO Reading from file f:/MOH/datamodel/audititem.txt with encoding UTF-8
+ extracted 71 rows (0 rows/sec) - 71 rows -> loaded 71 vertices (0 vertices/sec) Total time: 1010ms [0 warnings, 0 errors]
+ extracted 205 rows (132 rows/sec) - 205 rows -> loaded 204 vertices (131 vertices/sec) Total time: 2025ms [0 warnings, 0 errors]
END ETL PROCESSOR
+ extracted 495 rows (350 rows/sec) - 495 rows -> loaded 495 vertices (351 vertices/sec) Total time: 2853ms [0 warnings, 0 errors]

但是该课程出现在数据库中。

我应该如何设置etl流程?

1 个答案:

答案 0 :(得分:1)

这里有两个错误。

  1. 不需要使用dbUrl的单引号'

  2. 在etl发生时需要停止服务器。

  3. json文件现在如下:

    {
      "source": { "file": { "path": "f:/MOH/datamodel/audititem.txt" } },
      "extractor": { "csv": {}},
      "transformers": [
        { "vertex": { "class": "AuditIssue" } }
      ],
      "loader": {
        "orientdb": {
           "dbURL": "plocal:/orientdb/orientdb-community-2.1.15/databases/MOH v1.0",
           "dbUser": "admin",
           "dbPassword": "admin",
           "dbType": "graph",
           "classes": [
             {"name": "AuditIssue", "extends": "V"},
           ], "indexes": []
       }
      }
    }