Closed yusefnapora closed 8 years ago
You are right, this is related to both gremlin-scala and the orient driver. You see this error because orient doesn't (and shoulnd't) know anything about a scala Map. And you wouldn't get there in the first place if the serialisation macro in gremlin-scala would convert the scala Map to a java Map. For now you'll have to choose one of the workarounds you describe. I'm currently working on replacing the macro based serialiser with a shapeless based one (see https://github.com/netvl/picopickle/pull/17), and will address this problem there.
right on; I'll close this then :)
I wish I knew enough about shapeless to help out with the new serializer.
I wasn't sure whether to open this here or on gremlin-scala, but I think this is specific to orient serialization.
If I have a case class
Foo
with aMap[String, String]
field:and try to add it to a remote
OrientGraph
:Orient will spit out a huge stack trace... the relevant bit seems to be
This looks like the orient client lib is serializing the scala
Map
to a byte stream, but the remote orient server chokes because it doesn't know about scala...I can also get it to die client-side if I make a vertex class for
Foo
and set the field to be anEMBEDDEDMAP
, although then it fails because the scala map doesn't implementjava.util.Map
I've been working around this with a custom gremlin-scala marshaller, where I pull the
m
field out of thevalueMap
and convert to/from ajava.util.HashMap
Is this just a fundamental limitation of orient's serializer, or is there a correct way to do this? The only other workaround I can come up with is just using a
java.util.Map
as the field type in my case classes, and providing accessors to convert to/from scala collections.Thanks, and sorry in advance if this is a problem with orient / scala instead of this driver (which is excellent, btw)