为什么我使用这个 cql 导入 csv 数据失败?
why I use this cql import csv data failed?
我尝试使用包含 25000 行的 csv 文件导入关系数据,然后我使用这个密码:
USING PERIODIC COMMIT 500 LOAD CSV WITH HEADERS FROM 'http://127.0.0.1:88/static/relations/261.csv' AS line
MATCH (a:user{value:line.userId}),(b:device{value:line.deviceId})
MERGE (a)-[rel:myrelname]->(b)
WITH rel, COALESCE(rel.eventOccurTime, []) + line.eventOccurTime AS eventOccurTime
UNWIND eventOccurTime as r0
WITH rel, collect(distinct r0) AS unique
set rel.eventOccurTime= unique ,rel.business_name='data-test'
30 分钟后,我收到此错误:
[Neo.DatabaseError.Statement.ExecutionFailed]:连接重置,参考 0b8a3600-d715-44bf-8c5b-4260edeab459.
我该如何解决?
一些尝试:
简化(并加快)查询。无需展开然后 re-collect 列表的不同元素。除非确实需要,否则无需创建临时列表或附加到列表。
USING PERIODIC COMMIT 500 LOAD CSV WITH HEADERS FROM 'http://127.0.0.1:88/static/relations/261.csv' AS line
MATCH (a:user{value: line.userId}), (b:device{value: line.deviceId})
MERGE (a)-[rel:myrelname]->(b)
SET
rel.business_name='data-test',
rel.eventOccurTime = CASE
WHEN rel.eventOccurTime IS NULL THEN [line.eventOccurTime]
WHEN line.eventOccurTime IN rel.eventOccurTime THEN rel.eventOccurTime
ELSE rel.eventOccurTime + line.eventOccurTime END
您可能希望通过在以下位置创建 indexes 来提高性能:
:user(value)
:device(value)
使用PROFILE分析从你的Cypher生成的执行计划。
我尝试使用包含 25000 行的 csv 文件导入关系数据,然后我使用这个密码:
USING PERIODIC COMMIT 500 LOAD CSV WITH HEADERS FROM 'http://127.0.0.1:88/static/relations/261.csv' AS line
MATCH (a:user{value:line.userId}),(b:device{value:line.deviceId})
MERGE (a)-[rel:myrelname]->(b)
WITH rel, COALESCE(rel.eventOccurTime, []) + line.eventOccurTime AS eventOccurTime
UNWIND eventOccurTime as r0
WITH rel, collect(distinct r0) AS unique
set rel.eventOccurTime= unique ,rel.business_name='data-test'
30 分钟后,我收到此错误: [Neo.DatabaseError.Statement.ExecutionFailed]:连接重置,参考 0b8a3600-d715-44bf-8c5b-4260edeab459.
我该如何解决?
一些尝试:
简化(并加快)查询。无需展开然后 re-collect 列表的不同元素。除非确实需要,否则无需创建临时列表或附加到列表。
USING PERIODIC COMMIT 500 LOAD CSV WITH HEADERS FROM 'http://127.0.0.1:88/static/relations/261.csv' AS line MATCH (a:user{value: line.userId}), (b:device{value: line.deviceId}) MERGE (a)-[rel:myrelname]->(b) SET rel.business_name='data-test', rel.eventOccurTime = CASE WHEN rel.eventOccurTime IS NULL THEN [line.eventOccurTime] WHEN line.eventOccurTime IN rel.eventOccurTime THEN rel.eventOccurTime ELSE rel.eventOccurTime + line.eventOccurTime END
您可能希望通过在以下位置创建 indexes 来提高性能:
:user(value)
:device(value)
使用PROFILE分析从你的Cypher生成的执行计划。