我导入了一个包含人口统计信息的大表,我的ETL JSON看起来像这样
{
"config": {
"log": "debug"
},
"extractor" : {
"jdbc": { "driver": "com.mysql.jdbc.Driver",
"url": "jdbc:mysql://localhost/avicenna",
"userName": "xxxxxx",
"userPassword": "xxxxxxxxxxxx",
"query": "select * from patients",
"fetchSize": 1000
}
},
"transformers" : [
{ "vertex": { "class": "patients"} }
],
"loader" : {
"orientdb": {
"dbURL": "plocal:c:/tools/orientdb-community-2.0.5/databases/Avicenna",
"dbType": "graph",
"dbAutoCreate": true
}
}
}
我在OrientDB中的患者类定义如下
-------------------------------+-------------+
NAME | TYPE |
-------------------------------+-------------+
PatientID | INTEGER |
MaritalStatus | STRING |
DOB | DATE |
Sex | STRING |
-------------------------------+-------------+
尽管MySQL患者表将DOB字段创建为“日期”,但所有导入的数据仍会显示完整的DateTime
orientdb {db=avicenna}> select from patients limit 3
----+-----+--------+---------+-------------------+-------------+----+------------
# |@RID |@CLASS |PatientID|DOB |MaritalStatus|Sex |out_admitted
----+-----+--------+---------+-------------------+-------------+----+------------
0 |#18:0|patients|1022 |1996-02-29 00:00:00|Single |M |[size=5]
1 |#18:1|patients|1033 |1996-02-02 00:00:00|Single |M |[size=1]
2 |#18:2|patients|1089 |1995-07-21 00:00:00|Single |F |[size=1]
----+-----+--------+---------+-------------------+-------------+----+------------
我的导入脚本有问题吗? 现在我如何清理OrientDB中的日期?
答案 0 :(得分:0)
我相信你的剧本没有任何问题,这就是日期的存储方式。
create property V.someDate date
create property V.someDateTime datetime
insert into V set someDate = sysdate(), someDateTime = sysdate()
select from V