csv - OrientDB etl加载csv但看不到类中的记录

标签 csv etl orientdb

我使用的是orientdb 2.1.13

我可以加载 csv 文件 >> 请参阅 oetl 类名已创建,但看不到类中的记录 感谢您的支持。 雷恩。

测试.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"}
            ]
        }
    }
}

otl

[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

最佳答案

试试这个:

{
  "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

关于csv - OrientDB etl加载csv但看不到类中的记录,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36246303/

相关文章:

javascript - orientjs:在事务中更新插入边

orientdb - 托管许多东方数据库的最佳方式

r - 如何从字符向量中解析CSV数据以提取数据帧?

mysql - Python中的ETL脚本将数据从另一个服务器.csv文件加载到mysql中

sql-server - 尽管使用数据转换和准确的目标数据类型,SSIS 数据转换错误

postgresql - 临时表的 CloverETL 事务 block

database - 是否可以在 orientdb 的集群中使用集群?

Python - 将特定键的 json 数据转换为 csv 格式

amazon-web-services - 如何将 CSV 文件中的批量数据导入 DynamoDB?

python - 在 Python MatPlotLib 中生成频率热图,从 .csv 文件读取 X 和 Y 坐标