OrientDB etl加载csv但无法查看类中的记录

时间:2016-03-27 10:26:30

标签: csv etl orientdb

我正在使用orientdb 2.1.13

我可以加载csv文件>>请看oetl class名称已创建,但无法查看类中的记录 感谢您的支持。 RayN。

test.json

{

    "config": {"log":"debug"},

    "source": {"file": {"path": "/usr/share/orientdb-community-2.1.13/niloy_data/test.csv"}},

    "extractor":{ "csv": {}},

    "transformer": [
        {"vertex": {"class": "Names"}}
    ],

    "loader": {
        "orientdb": {
            "dbURL": "plocal:/usr/share/orientdb-community-2.1.13/databases/test",
            "dbType": "graph",
            "dbUser": "admin",
            "dbPassword": "admin",
            "dbAutoCreate":true,
            "batchCommit": 100,
            "classes": [
                {"name": "Names","extends": "V"}
            ],
            "indexes": [
                {"class": "Names", "fields":["num:integer"], "type":"UNIQUE"}
            ]
        }
    }
}

oetl

  

[osboxes @ osboxes bin] $ ./oetl.sh ../niloy_data/test.json OrientDB etl   v.2.1.13(build 2.1.x@r9bc1a54a4a62c4de555fc5360357f446f8d2bc84;   2016-03-14 17:00:05 + 0000)www.orientdb.com

BEGIN ETL PROCESSOR [file]
INFO Reading from file /usr/share/orientdb-community-2.1.13/niloy_data/test.csv with encoding UTF-8 
[orientdb] DEBUG - OrientDBLoader: created vertex class 'Names' extends 'V' [orientdb] DEBUG orientdb: found 0 vertices in class 'null' 
[orientdb] DEBUG orientdb: found metadata field 'null'
[orientdb] DEBUG - OrientDBLoader: created property 'Names.num' of type: integer 
[orientdb] DEBUG - OrientDocumentLoader: created index 'Names.num' type 'UNIQUE' against Class 'Names', fields [num:integer]
[csv] DEBUG document={name:abcd,num:1213} 
[csv] DEBUG document={name:fads,num:725} 
[csv] DEBUG document={name:pyiu,num:9376}
[csv] DEBUG document={name:agido,num:430} 
END ETL PROCESSOR + extracted 4 rows (0 rows/sec) - 4 rows -> loaded 4 vertices (0 vertices/sec) Total time: 556ms [0 warnings, 0 errors]

连接

orientdb {db = test}>列表类

CLASSES
------------------+------------------+------------+----------------+
 NAME             | SUPERCLASS       | CLUSTERS   | RECORDS        |
------------------+------------------+------------+----------------+
 E                |                  | 10         |              0 |
 Names            | [V]              | 11         |              0 |
 OFunction        |                  | 6          |              0 |
 OIdentity        |                  | -          |              0 |
 ORestricted      |                  | -          |              0 |
 ORIDs            |                  | 8          |              0 |
 ORole            | [OIdentity]      | 4          |              3 |
 OSchedule        |                  | 7          |              0 |
 OTriggered       |                  | -          |              0 |
 OUser            | [OIdentity]      | 5          |              3 |
 V                |                  | 9          |              0 |
------------------+------------------+------------+----------------+
 TOTAL = 11       |                  |            |              6 |             
------------------+------------------+------------+----------------+
orientdb {db=test}> bye

1 个答案:

答案 0 :(得分:2)

试试这个:

{
  "source": { "file": { "path": "/usr/share/orientdb-community-2.1.13/niloy_data/test.csv" } },
  "extractor": { "row": {} },
  "transformers": [
    { "csv": {} },
    {"vertex": {"class": "Names"} }
  ],
  "loader": {
    "orientdb": {
       "dbURL": "plocal:/usr/share/orientdb-community-2.1.13/databases/test",
       "dbType": "graph",
       "classes": [
         {"name": "Names","extends": "V"},
       ], "indexes": [
         {"class": "Names", "fields":["num:integer"], "type":"UNIQUE" }
       ]
    }
  }
}

结果如下:

enter image description here