我有最新的社区版2.2.17。使用csv导入啤酒数据库时导入啤酒时出错。 (类别,款式等都进口良好)。 错误如下:
OrientDB etl v.2.2.17 (build 2.2.x@rd9bace82ea8437117fd48114fc255e791056014b; 2017-02-16 17:20:27+0000) www.orientdb.com
[csv] INFO column types: {last_mod=ANY, abv=ANY, filepath=ANY, name=ANY, cat_id=ANY, upc=ANY, id=ANY, brewery_id=ANY, style_id=ANY, descript=ANY, ibu=ANY, srm=ANY}
BEGIN ETL PROCESSOR
[file] INFO Reading from file C:/Database_studies/nosql/orientdb/Import/OrientDB_self_study_files/beerdb/openbeerdb_csv/beers.csv with encoding UTF-8
Started execution with 1 worker threads
[csv] ERROR Error on converting row 1 field 'last_mod' , value '2010-07-22 20:00:20' (class:java.lang.String) to type: ANY
[csv] ERROR Error on converting row 1 field 'abv' , value '4.5' (class:java.lang.String) to type: ANY
[csv] ERROR Error on converting row 1 field 'filepath' , value '' (class:java.lang.String) to type: ANY
[csv] ERROR Error on converting row 1 field 'name' , value 'Hocus Pocus' (class:java.lang.String) to type: ANY
[csv] ERROR Error on converting row 1 field 'cat_id' , value '11' (class:java.lang.String) to type: ANY
[csv] ERROR Error on converting row 1 field 'upc' , value '0' (class:java.lang.String) to type: ANY
[csv] ERROR Error on converting row 1 field 'id' , value '1' (class:java.lang.String) to type: ANY
[csv] ERROR Error on converting row 1 field 'brewery_id' , value '812' (class:java.lang.String) to type: ANY
[csv] ERROR Error on converting row 1 field 'style_id' , value '116' (class:java.lang.String) to type: ANY
[csv] ERROR Error on converting row 1 field 'descript' , value 'Our take on a classic summer ale. A toast to weeds, rays, and summer haze. A light, crisp ale for mowing lawns, hitting lazy fly balls, and communing with nature, Hocus Pocus is offered up as a summer sacrifice to clodless days.
Its malty sweetness finishes tart and crisp and is best apprediated with a wedge of orange.' (class:java.lang.String) to type: ANY
[csv] ERROR Error on converting row 1 field 'ibu' , value '0' (class:java.lang.String) to type: ANY
[csv] ERROR Error on converting row 1 field 'srm' , value '0' (class:java.lang.String) to type: ANY
[csv] ERROR Error on converting row 2 field 'last_mod' , value '2010-07-22 20:00:20' (class:java.lang.String) to type: ANY
[csv] ERROR Error on converting row 2 field 'abv' , value '6.7' (class:java.lang.String) to type: ANY
[csv] ERROR Error on converting row 2 field 'filepath' , value '' (class:java.lang.String) to type: ANY
[csv] ERROR Error on converting row 2 field 'name' , value 'Grimbergen Blonde' (class:java.lang.String) to type: ANY
[csv] ERROR Error on converting row 2 field 'cat_id' , value '-1' (class:java.lang.String) to type: ANY
[csv] ERROR Error on converting row 2 field 'upc' , value '0' (class:java.lang.String) to type: ANY
[csv] ERROR Error on converting row 2 field 'id' , value '2' (class:java.lang.String) to type: ANY
[csv] ERROR Error on converting row 2 field 'brewery_id' , value '264' (class:java.lang.String) to type: ANY
[csv] ERROR Error on converting row 2 field 'style_id' , value '-1' (class:java.lang.String) to type: ANY
我用来导入的命令与文档中给出的命令相同: ./oetl.sh /temp/openbeer/beers.json
(目录名称已更改为我系统中的实际名称)。
有人可以建议。
这是我的beers.json文件:
{
"config" : { "haltOnError": false },
"source": { "file": { "path": "C:/Database_studies/nosql/orientdb/Import/OrientDB_self_study_files/beerdb/openbeerdb_csv/beers.csv" } },
"extractor": { "csv": { "columns": ["id","brewery_id","name","cat_id","style_id","abv","ibu","srm","upc","filepath","descript","last_mod"],
"columnsOnFirstLine": true } },
"transformers": [
{ "vertex": { "class": "Beer" } },
{ "edge": { "class": "HasCategory", "joinFieldName": "cat_id", "lookup": "Category.id" } },
{ "edge": { "class": "HasBrewery", "joinFieldName": "brewery_id", "lookup": "Brewery.id" } },
{ "edge": { "class": "HasStyle", "joinFieldName": "style_id", "lookup": "Style.id" } }
],
"loader": {
"orientdb": {
"dbURL": "plocal:C:/orientdb_install_031217/orientdb-community-2.2.17/databases/openbeerdb",
"dbType": "graph",
"classes": [
{"name": "Beer", "extends": "V"},
{"name": "HasCategory", "extends": "E"},
{"name": "HasStyle", "extends": "E"},
{"name": "HasBrewery", "extends": "E"}
], "indexes": [
{"class":"Beer", "fields":["id:integer"], "type":"UNIQUE" }
]
}
}
}
谢谢, DBuserN
答案 0 :(得分:0)
我的建议是解释每列的类型
0.1
检查CSV提取器文档:
http://orientdb.com/docs/last/Extractor.html
确保默认的dateTimeFormat适合您的输入文件。