Details
-
Improvement
-
Status: Open
-
Major
-
Resolution: Unresolved
-
3.7.1, 3.6.7, 3.7.2
-
None
-
None
Description
One could argue whether this is a bug or a feature request but the following behavior from the onCreate part of mergeV is confusing for an end user who expects it to work. You could further argue that specifying cardinality during onCreate is redundant, but the error message about the default Boolean on the stream will be very confusing for a user as unless they understand the implementation will have no idea where that Boolean even comes from.
Setup to reproduce just an empty TinkerGraph and a fairly recent release
gremlin> Gremlin.version() ==>3.7.1 gremlin> g.mergeV([(T.id): 1, (T.label): 'airport']). ......1> option(onCreate, property(single,"prop", 1).constant([:])). ......2> option(onMatch, property(single,"prop", 2).constant([:])).valueMap() java.lang.Boolean cannot be cast to org.apache.tinkerpop.gremlin.structure.Element
If the query is rewritten as follows it works fine
gremlin> g.mergeV([(T.id): 1, (T.label): 'airport']). ......1> option(onCreate, [prop: 1]). ......2> option(onMatch, property(single,"prop", 2).constant([:])).valueMap() ==>[prop:[1]] gremlin> g.mergeV([(T.id): 1, (T.label): 'airport']). ......1> option(onCreate, [prop: 1]). ......2> option(onMatch, property(single,"prop", 2).constant([:])).valueMap() ==>[prop:[2]]