Edge属性从ETL中破坏OrientDB中的顶点属性

时间:2016-08-01 15:42:38

标签: orientdb orientdb2.2 orientdb-etl

这是我发布的关于使用ETL将简单数据库导入OrientDB的follow-up to another question,其中包含边缘和顶点属性,两者都有日期。

这是我的数据:

vertices.csv

label,data,date
v01,0.1234,2015-01-01
v02,0.5678,2015-01-02
v03,0.9012,2015-01-03

edges.csv

u,v,weight,date
v01,v02,12.4,2015-06-17
v02,v03,17.9,2015-09-14

为简洁起见,我将使用其他问题的编辑添加更新的commonEdges.json文件。其他JSON文件没有变化。

commonEdges.json

{
    "begin": [ { "let": { "name": "$filePath", "expression": "$fileDirectory.append($fileName )" } } ],
    "config": { "log": "info" },
    "source": { "file": { "path": "$filePath" } },
    "extractor": { "csv": { "ignoreEmptyLines": true,
                            "nullValue": "N/A",
                            "dateFormat": "yyyy-mm-dd"
                          }
                 },
    "transformers": [
          { "merge":  { "joinFieldName": "u", "lookup": "myVertex.label" } },
          { "edge":   { "class":         "myEdge",
                        "joinFieldName": "v",
                        "lookup":        "myVertex.label",
                        "edgeFields":    { "weight": "${input.weight}", "date": "${input.date}" },
                        "direction":     "out",
                        "unresolvedLinkAction": "NOTHING"
                      }
          },
          { "field": { "fieldNames": ["u", "v"], "operation": "remove" } }
    ],
    "loader": {
        "orientdb": {
            "dbURL": "plocal:my_orientdb",
            "dbType": "graph",
            "batchCommit": 1000,
            "useLightweightEdges": false,
            "classes": [ { "name": "myEdge",   "extends", "E" } ],
            "indexes": []
        }
    }
}

加载图表后,日期字段仍然被破坏。

如果我加载边缘,这是顶点表:

orientdb {db=my_orientdb}> SELECT FROM myVertex

+----+-----+--------+------+-------------------+-----+
|#   |@RID |@CLASS  |data  |date               |label|
+----+-----+--------+------+-------------------+-----+
|0   |#25:0|myVertex|0.1234|2015-01-01 00:01:00|v01  |
|1   |#26:0|myVertex|0.5678|2015-01-02 00:01:00|v02  |
|2   |#27:0|myVertex|0.9012|2015-01-03 00:01:00|v03  |
+----+-----+--------+------+-------------------+-----+

一切看起来都是正确的,日期是1/1/15 - 1/3/15。

加载边后,日期字段错误:

orientdb {db=my_orientdb}> SELECT FROM myVertex

+----+-----+--------+------+-------------------+-----+------+----------+---------+
|#   |@RID |@CLASS  |data  |date               |label|weight|out_myEdge|in_myEdge|
+----+-----+--------+------+-------------------+-----+------+----------+---------+
|0   |#25:0|myVertex|0.1234|2015-01-17 00:06:00|v01  |12.4  |[#33:0]   |         |
|1   |#26:0|myVertex|0.5678|2015-01-14 00:09:00|v02  |17.9  |[#34:0]   |[#33:0]  |
|2   |#27:0|myVertex|0.9012|2015-01-03 00:01:00|v03  |      |          |[#34:0]  |
+----+-----+--------+------+-------------------+-----+------+----------+---------+

边缘的日期也不正确:

orientdb {db=my_orientdb}> SELECT FROM myEdge

+----+-----+------+-----+-----+------+-------------------+
|#   |@RID |@CLASS|out  |in   |weight|date               |
+----+-----+------+-----+-----+------+-------------------+
|0   |#33:0|myEdge|#25:0|#26:0|12.4  |2015-01-17 00:06:00|
|1   |#34:0|myEdge|#26:0|#27:0|17.9  |2015-01-14 00:09:00|
+----+-----+------+-----+-----+------+-------------------+

看起来OrientDB正在用已经加载的日期破坏日期...但是边缘的月份字段以某种方式进入分钟字段。它也以这种方式显示顶点和边缘。

这只是OrientDB的一个错误,还是我错过了ETL文件中的内容?

提前感谢您的任何帮助或建议。

0 个答案:

没有答案