我一直尝试在最新版本的 Neo4j 3.1.0 和 APOC 3.1.0.3 中运行 apoc.load.csv
过程。
CALL apoc.periodic.iterate('CALL apoc.load.csv("file:///data.csv",
{sep:",", header:TRUE}) yield map ','
with {map} as map MATCH (t:Tweet{id:toFloat(map.tweet_id)})
SET t.clean_text = map.clean_text,
t.positive_score = toInt(map.nb_positive),
t.negative_score = toInt(map.nb_negative),
t.sentiment_score = toInt(map.score)',
{batchSize:5000, parallel:true})
Error: Failed to invoke procedure
apoc.periodic.iterate
: Caused by: org.neo4j.graphdb.QueryExecutionException: Failed to invoke procedureapoc.load.csv
: Caused by: java.lang.RuntimeException: Import from files not enabled, please set apoc.import.file.enabled=true in your neo4j.conf
我尝试只运行 apoc.load.csv
片段,但仍然收到相同的错误,告诉我将该语句添加到我的 neo4j.conf
文件中,该文件我有。我什至重新启动了计算机。
我能够在 Neo4j 3.0.6 和 APOC 3.0.4.1 中成功运行完全相同的语句,但自从升级后它就不起作用了。
最佳答案
我认为这可能是一个错误。
如果您单击浏览器中的“星号”,然后在“系统”下会出现一个指向“服务器配置”的链接。运行此查询以查看 Neo4J 认为它有什么 wrt 设置。
其中一部分看起来像:
{
"isIs": "false ",
"name": "apoc.export.file.enabled",
"description": "Configuration attribute",
"type": "java.lang.String",
"isReadable": "true",
"value": "true",
"isWriteable": "false "
},
这表明文件导入设置存在并且格式正确。
问题是为什么这没有得到尊重?这是我在面临同样问题时所能确定的。
关于Neo4j 3.1.0 apoc.load.csv 问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41190251/