-
Notifications
You must be signed in to change notification settings - Fork 112
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to write relationship #325
Comments
bump |
The error says
You can find more about this issue on the official docs
So I would try this: finalSiteStudyDF.write
.mode("Append") // <-- added this
.format("org.neo4j.spark.DataSource")
.option("url", NEO4JURL)
.option("authentication.type", "basic")
.option("batch.size", 2500)
.option("transaction.retries", "10")
.option("relationship.save.strategy", "keys")
.option("authentication.basic.username", "neo4j")
.option("authentication.basic.password", "zeppelin")
.option("relationship", "HAS_SITE")
.option("relationship.source.save.mode", "Match")
.option("relationship.source.labels", ":Study")
.option("relationship.source.node.keys", "NCT_ID")
.option("relationship.target.save.mode", "Match")
.option("relationship.target.labels", ":Site")
.option("relationship.target.node.keys", "ID") Let me know! |
Bah! I figured it would be something simple like this ha! It works now, thanks so much! I would suggest to add this aditional paramter to the documentation - I at least do not see it present https://neo4j.com/developer/spark/writing/#bookmark-write-rel Thanks again for your time and for developing this very awesome module! |
All good! I think we need to make it more clear 😄 Our plan is actually to support ErrorIfExists... but we are having some troubles getting through that. Hopefully it will be done in the near future. |
I am following the documentation to write relationships to aa neo4j db. I am able to write nodes but for relationships I get the following stack trace:
Here is the dataframe schema I am trying to write:
and my code:
I have also tried using "Overwrite" as the save.mode with the same result.
The expected behavior is of course for this to write my relationship edges.
Scala version = 2.12.10
Spark version = 3.1.1
Neo4j jar connector included in spark jars and in SBT file like:
"neo4j-contrib" %% "neo4j-connector-apache-spark" % "4.0.1_for_spark_3"
Kind of stumped here, what could be the issue?
The text was updated successfully, but these errors were encountered: