apache-spark - 无法创建 CONSTRAINT ON (___neo4jgraphs:___neo4jgraphs)
问题描述
我正在尝试将使用Cypher-for-Apache-Spark项目从Spark- dataframes 创建的图形存储到neo4j中。
当我运行我的代码时:您可以在 github 问题的最后一条评论中找到它
我收到此错误:
Exception in thread "main" org.neo4j.driver.v1.exceptions.DatabaseException: Unable to create CONSTRAINT ON ( ___neo4jgraphs874:___neo4jgraphs874 ) ASSERT ___neo4jgraphs874.___morpheusID IS UNIQUE:
Both Node(57) and Node(74) have the label `___neo4jgraphs874` and property `___morpheusID` = 4
任何人都知道为什么会这样?
解决方案
在这里解决了 我已经弄清楚了问题所在:由于数据帧具有相同的 ID 号,因此触发了此错误:
df1||df2||df3
0L||0L ||0L
1L||1L ||1L
2L||2L ||2L
要修复每个数据帧,它的 id 必须与另一个不同:
df1||df2||df3
0L||3L ||6L
1L||4L ||7L
2L||5L ||8L
推荐阅读
- node.js - 在 Azure CI/CD 管道中使用 npm 工作区来构建 React Web 应用程序?
- javascript - Passport JS 无法读取未定义的属性(读取“初始化”)
- node.js - 调试器在 WSL1 ubuntu-dev-environment 中的 NodeJS 中不起作用?
- java - 如何使这个 for 循环反复遍历数组列表,直到达到条件?
- sql-server - SSMS Snippet - 多次使用 SurroundsWith 的选择
- c++ - 在原子布尔值上使用 compare_exchange_strong (C++)
- reactjs - 如何使用 react 或 Gatsby(whitout 窗口 || 文档)在 url 中处理(获取、设置)查询字符串
- matlab - 为什么 Encoder readSpeed() 的对象只有我输出 0 或 6.2500?
- c# - C# 全局日志记录
- tensorflow - 在多台机器上运行 TensorFlow Federated