LOAD CSV WITH HEADERS FROM "file:///C:/Users/SESA472806/Desktop/CustomerTagDB_IOAssgiment_M91_with_IO_Allocation_LAST_4.csv" as line
with line, line.`Plant Name` as plnt
Call{
with line, plnt
merge(p:Plant{Name : plnt})
SET p.validCount ='null', p.projectName = 'Null', p.projectId = 'Null', p.progress ='Null', p.modelValidCount = 'Null', p.modelinstabceCount = 'Null', p.modelBadCount = 'Null', p.isPropagated = 'Null' , p.isCustomerLoaded = 'Null', p.isControlLoaded = 'Null', p.instanceCount = 'Null', p.CutomerDbPath = 'Null', p.ControlDbPath = 'Null', p.badCount = 'Null', p.AmlPath = 'Null' , p.allProjectPath = 'Null'
return p
}
return p
错误:
Illegal char <:> at index 3: /C:/Users/SESA472806/Desktop/CustomerTagDB_IOAssgiment_M91_with_IO_Allocation_LAST_4.csv ? What is the error in neo4j
我不能理解这个错误吗?我之前使用过相同的代码?
我没有 Windows,所以我无法测试您的查询。
不过,我确实有两种不同的理论。
存在安全限制,阻止 LOAD CSV 从本地系统上的任何目录读取,但只能读取导入文件夹下的内容。可能是您以前使用过旧版本,以前没有此安全限制。
这是由 neo4j.conf 中的此配置控制的:
server.directories.import=import
删除或注释掉它以访问整个文件系统(但请考虑其安全隐患)。
如果不是这种情况,可能是因为 CSV 的列名称中有
:
。
此问题已在 Neo4j 5.5.0 中修复。现在,如果标头条目还指定了属性类型,例如
my-key:with-colons:string