mpollmeier / gremlin-scala

[unmaintained] Scala wrapper for Apache TinkerPop 3 Graph DSL
Apache License 2.0
482 stars 76 forks source link

Support for list types with cardinality #284

Open bowofolaf opened 5 years ago

bowofolaf commented 5 years ago

Hi,

Please see the following SO question. This happened when using Seq and List for properties on my CC.

https://stackoverflow.com/questions/56568962/unsupported-property-value-type-java-util-linkedhashmap-when-writing-to-neptune

I was able to step through your code, and it appears that for a List type addVertex proceeds to add the whole list as a property which is unsupported. Is there a way to make it iterate through and add all said items to the property the Gremlin way i.e.

g.addV("person").property("friend", "john").property("friend","joe")
mpollmeier commented 5 years ago

from the stack overflow question: Unsupported property value type: java.util.LinkedHashMap I don't have a working neptune setup, but a plain scala List might work. If not, here's the relevant sections in the macro: https://github.com/mpollmeier/gremlin-scala/blob/2e32ae0/macros/src/main/scala/gremlin/scala/Marshallable.scala#L178-L179 https://github.com/mpollmeier/gremlin-scala/blob/2e32ae0/macros/src/main/scala/gremlin/scala/Marshallable.scala#L110-L120

bowofolaf commented 5 years ago

Thanks, will try this and get back to you

bowofolaf commented 5 years ago

Plain scala List didnt work. Even Map doesn't work. Seems like a neptune feature gap, but will try and confirm this.

bowofolaf commented 5 years ago

From Neptune team:

Neptune supports Single and Set cardinality properties when using the Gremlin property() step etc. It currently does not support List cardinality. Now those are all 'TinkerPop' types. What Neptune also does not support is arbitrary Java data types

So as I first suggested, the issue is addVertex/marshaller does not support translating lists to list cardinality properties, or sets to set cardinality properties but instead tries to just shove the whole object in.

Also from Neptune team

You should not assume hosted graph databases which have to be more language agnostic will support native programming language complex types such as maps and hashes.