Spark (connector version 2.1.0-M4) with neo4j 3.4.5

spark

(Niv) #1

Hi,
i build a data processing using neo4j-spark-connector(v 2.1.0-M4). until now i used neo4j 3.3 and everything works fine.
i need to improve this process now, and for do it i need to use neo4j 3.4.5 features(datetime field) -
part of the code:
val date = Calendar.getInstance()
date.add(Calendar.DATE, -30)
date.set(Calendar.HOUR_OF_DAY, 0)
date.set(Calendar.MINUTE, 0)
date.set(Calendar.SECOND, 0)
date.set(Calendar.MILLISECOND, 0)

val d = ZonedDateTime.ofInstant(date.toInstant(), ZoneId.of(("UTC")))
val map = Map("date" -> d)

neo4j.cypher(relevanceQuery, map)

the map works because if i put long parameters it works.

the error i get:
org.neo4j.driver.v1.exceptions.ClientException: Unable to convert java.time.ZonedDateTime to Neo4j Value.

hope someone will help,
thanks,
Niv.


(Michael Hunger) #2

We probably need to update the java driver version, I'll do that this week.


(Niv) #3

many thanks michael!


(Niv) #4

hi michael,
you know when it will be ready?

Thanks,
Niv.


(Michael Hunger) #5

Sorry I ran into a number of build errors as part of the update, that have to be fixed first.


(Niv) #6

maybe you have some estimation?

i changed all date properties to work with the new date type(before 3.4 the properties were just a long number), and now i'm a little bit stuck because of it :\ , cant upload new sprint to production.

thanks,
Niv.


(Michael Hunger) #7

It would be good to have some time to work through some of the other open issues and suggestions, but I'm afraid I won't have the capacity right now.


(Niv) #8

@michael.hunger
hi,
As i said on github, the jar works for me. so thanks!

last thing,
you can upload it to the maven repository too?
the latest version there is 2.2.1-M5
(https://mvnrepository.com/artifact/neo4j-contrib/neo4j-spark-connector)

thanks,
Niv.


(Michael Hunger) #9

Yes I'm trying, there are some issues mit maven central :frowning:


(Michael Hunger) #10

Here you go:

https://spark-packages.org/package/neo4j-contrib/neo4j-spark-connector

Please let me know if it works.


(Niv) #11

@michael.hunger

it works! :)
thanks!


(Michael Hunger) #12

Something that would help me tremendously would be some other folks describing / documenting how they use the connector. So if you have a few minutes at some time I would very much appreciate a blog post explaining how you use it and also feedback on what could be improved.


(Niv) #13

no problem,
will do it soon :)