Skip to content
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

Support for list types with cardinality #284

Open
bowofolaf opened this issue Jun 12, 2019 · 4 comments
Open

Support for list types with cardinality #284

bowofolaf opened this issue Jun 12, 2019 · 4 comments

Comments

@bowofolaf
Copy link
Contributor

bowofolaf commented Jun 12, 2019

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
Copy link
Owner

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
Copy link
Contributor Author

Thanks, will try this and get back to you

@bowofolaf
Copy link
Contributor Author

bowofolaf commented Jun 26, 2019

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

@bowofolaf
Copy link
Contributor Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants