Details
-
Bug
-
Status: Closed
-
Critical
-
Resolution: Duplicate
-
3.7.1
-
None
-
None
-
None
Description
The following Stack Overflow post (link below) reported some issues with mergeV when side effects and cardinality are used (as well as with 3 mergeV steps chained together). The issue reproduces on 3.7.1 using TinkerGraph.
Reproduction steps
gremlin> g=TinkerGraph.open().traversal() ==>graphtraversalsource[tinkergraph[vertices:0 edges:0], standard] gremlin> g.mergeV([(T.id):'v-1']). ......1> option(onCreate, [(T.label): 'Person', 'email': 'person-1@example.org', 'age': 12]). ......2> option(onMatch, sideEffect(property(single, 'email', 'person-1@example.org')). ......3> sideEffect(property(single, 'age', 22)).constant([:])). ......4> mergeV([(T.id):'v-2']). ......5> option(onCreate, [(T.label): 'Person', 'email': 'person-2@example.org', 'age': 13]). ......6> option(onMatch, sideEffect(property(single, 'email', 'person-2@example.org')). ......7> sideEffect(property(single, 'age', 23)).constant([:])). ......8> mergeV([(T.id):'v-3']). ......9> option(onCreate, [(T.label): 'Person', 'email': 'person-3@example.org', 'age': 14]). .....10> option(onMatch, sideEffect(property(single, 'email', 'person-3@example.org')). .....11> sideEffect(property(single, 'age', 24)).constant([:])). .....12> id() ==>v-3 gremlin> g.V().valueMap(true) ==>[id:v-2,label:Person,email:[person-2@example.org],age:[13]] ==>[id:v-1,label:Person,email:[person-1@example.org],age:[12]] ==>[id:v-3,label:Person,email:[person-3@example.org],age:[14]] gremlin> g.mergeV([(T.id):'v-1']). ......1> option(onCreate, [(T.label): 'Person', 'email': 'person-1@example.org', 'age': 12]). ......2> option(onMatch, sideEffect(property(single, 'email', 'person-1@example.org')). ......3> sideEffect(property(single, 'age', 22)).constant([:])). ......4> mergeV([(T.id):'v-2']). ......5> option(onCreate, [(T.label): 'Person', 'email': 'person-2@example.org', 'age': 13]). ......6> option(onMatch, sideEffect(property(single, 'email', 'person-2@example.org')). ......7> sideEffect(property(single, 'age', 23)).constant([:])). ......8> mergeV([(T.id):'v-3']). ......9> option(onCreate, [(T.label): 'Person', 'email': 'person-3@example.org', 'age': 14]). .....10> option(onMatch, sideEffect(property(single, 'email', 'person-3@example.org')). .....11> sideEffect(property(single, 'age', 24)).constant([:])). .....12> id() ==>v-3 gremlin> g.V().valueMap(true) ==>[id:v-2,label:Person,email:[person-3@example.org],age:[24]] ==>[id:v-1,label:Person,email:[person-2@example.org],age:[23]] ==>[id:v-3,label:Person,email:[person-3@example.org],age:[14]] gremlin>
The query seems to be both updating values in the incorrect vertices as well as leaving some values unchanged.
Attachments
Issue Links
- duplicates
-
TINKERPOP-3056 mergeE is updating vertices in certain conditions
- Closed