将大型 CSV 文件导入 OrientDB
Importing large CSV file into OrientDB
我是 orient-db 的新手,所以我正在使用 Orient-db 中的航班搜索图数据库。我有数百万的真实航班数据,我创建了 JSON
文件来导入 csv
文件,但是导入所有数百万数据需要花费数小时和数小时。它每秒仅导入大约 500 行。
我使用 etl 导入 csv 文件。
这是我的 json 文件
{
"source": {
"file": {
"path": "C:/Users/sams/Desktop/OrientDB2/flights.csv"
}
},
"extractor": {
"csv": {}
},
"transformers": [
{
"vertex": {
"class": "Flight"
}
},
{
"edge":
{
"class": "Has_Flight",
"joinFieldName": "depart_airport_id",
"lookup": "Airport.airport_id",
"direction": "in"
}
},
{
"edge":
{
"class": "Flying_To",
"joinFieldName": "arrive_airport_id",
"lookup": "Airport.airport_id",
"direction": "out"
}
}
],
"loader": {
"orientdb": {
"dbURL": "plocal:C:/Users/sams/Desktop/OrientDB2/database/dataflight",
"dbType": "graph",
"dbAutoCreate": true,
"classes": [
{
"name": "Airport",
"extends": "V"
},
{
"name": "Flight",
"extends": "V"
},
{
"name": "Has_Flight",
"extends": "E"
},
{
"name": "Flying_To",
"extends": "E"
}
],
"indexes": [
{
"class": "Airport",
"fields": [
"airport_id:integer"
],
"type": "UNIQUE"
}
]
}
}
}
所以我的问题是,在Orient-db中是否有任何其他机制可以导入大数据集?
提前致谢!
您可以尝试禁用 WAL,启用 txLog 并使用批处理。
让我们试试看:
"wal" = false
"batchCommit" = 1000
"txUseLog" = true
关于 OrientDb 加载器的文档:http://orientdb.com/docs/2.1/Loader.html#orientdb
如果您找到可以提高性能的组合,请告诉我。
我是 orient-db 的新手,所以我正在使用 Orient-db 中的航班搜索图数据库。我有数百万的真实航班数据,我创建了 JSON
文件来导入 csv
文件,但是导入所有数百万数据需要花费数小时和数小时。它每秒仅导入大约 500 行。
我使用 etl 导入 csv 文件。
这是我的 json 文件
{
"source": {
"file": {
"path": "C:/Users/sams/Desktop/OrientDB2/flights.csv"
}
},
"extractor": {
"csv": {}
},
"transformers": [
{
"vertex": {
"class": "Flight"
}
},
{
"edge":
{
"class": "Has_Flight",
"joinFieldName": "depart_airport_id",
"lookup": "Airport.airport_id",
"direction": "in"
}
},
{
"edge":
{
"class": "Flying_To",
"joinFieldName": "arrive_airport_id",
"lookup": "Airport.airport_id",
"direction": "out"
}
}
],
"loader": {
"orientdb": {
"dbURL": "plocal:C:/Users/sams/Desktop/OrientDB2/database/dataflight",
"dbType": "graph",
"dbAutoCreate": true,
"classes": [
{
"name": "Airport",
"extends": "V"
},
{
"name": "Flight",
"extends": "V"
},
{
"name": "Has_Flight",
"extends": "E"
},
{
"name": "Flying_To",
"extends": "E"
}
],
"indexes": [
{
"class": "Airport",
"fields": [
"airport_id:integer"
],
"type": "UNIQUE"
}
]
}
}
}
所以我的问题是,在Orient-db中是否有任何其他机制可以导入大数据集?
提前致谢!
您可以尝试禁用 WAL,启用 txLog 并使用批处理。
让我们试试看:
"wal" = false
"batchCommit" = 1000
"txUseLog" = true
关于 OrientDb 加载器的文档:http://orientdb.com/docs/2.1/Loader.html#orientdb
如果您找到可以提高性能的组合,请告诉我。