I want to load the data into neo4j using spark. I have installed apache spark and adding neo4j connector using python code.
df.write.format("org.neo4j.spark.DataSource")
.option("url","url" )
.option("authentication.type", "basic").option("authentication.basic.username", "xx")
.option("authentication.basic.password","xxxx")
.option("query", "MERGE (city:City{locationId:event.LOCALITY_ID}) ON CREATE SET city.city = event.LOCALITY_NAME")
.mode("Overwrite")
.save()
I am using neo4j apache connector.
neo4j-connector-apache-spark_2.12-4.0.1_for_spark_3.jar
However when i am executing , i am getting below error.
21/08/06 11:29:48 ERROR SchemaService: Query not compiled because of the following exception:
org.neo4j.driver.exceptions.ClientException: Variable event not defined (line 2, column 29 (offset: 71))
"MERGE (city:City{locationId:event.LOCALITY_ID}) ON CREATE SET city.city = event.LOCALITY_NAME"