Kelvin Lawrence created TINKERPOP-3036:
------------------------------------------
Summary: mergeV updating incorrect vertices and other issues
Key: TINKERPOP-3036
URL: https://issues.apache.org/jira/browse/TINKERPOP-3036
Project: TinkerPop
Issue Type: Bug
Affects Versions: 3.7.1
Reporter: Kelvin Lawrence
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.
[https://stackoverflow.com/questions/77803485/batch-mergev-working-well-when-creating-items-but-yielding-unexpected-results-w]
Reproduction steps
{code:java}
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':
'[email protected]', 'age': 12]).
......2> option(onMatch, sideEffect(property(single, 'email',
'[email protected]')).
......3> sideEffect(property(single, 'age',
22)).constant([:])).
......4> mergeV([(T.id):'v-2']).
......5> option(onCreate, [(T.label): 'Person', 'email':
'[email protected]', 'age': 13]).
......6> option(onMatch, sideEffect(property(single, 'email',
'[email protected]')).
......7> sideEffect(property(single, 'age',
23)).constant([:])).
......8> mergeV([(T.id):'v-3']).
......9> option(onCreate, [(T.label): 'Person', 'email':
'[email protected]', 'age': 14]).
.....10> option(onMatch, sideEffect(property(single, 'email',
'[email protected]')).
.....11> sideEffect(property(single, 'age',
24)).constant([:])).
.....12> id()
==>v-3
gremlin> g.V().valueMap(true)
==>[id:v-2,label:Person,email:[[email protected]],age:[13]]
==>[id:v-1,label:Person,email:[[email protected]],age:[12]]
==>[id:v-3,label:Person,email:[[email protected]],age:[14]]
gremlin> g.mergeV([(T.id):'v-1']).
......1> option(onCreate, [(T.label): 'Person', 'email':
'[email protected]', 'age': 12]).
......2> option(onMatch, sideEffect(property(single, 'email',
'[email protected]')).
......3> sideEffect(property(single, 'age',
22)).constant([:])).
......4> mergeV([(T.id):'v-2']).
......5> option(onCreate, [(T.label): 'Person', 'email':
'[email protected]', 'age': 13]).
......6> option(onMatch, sideEffect(property(single, 'email',
'[email protected]')).
......7> sideEffect(property(single, 'age',
23)).constant([:])).
......8> mergeV([(T.id):'v-3']).
......9> option(onCreate, [(T.label): 'Person', 'email':
'[email protected]', 'age': 14]).
.....10> option(onMatch, sideEffect(property(single, 'email',
'[email protected]')).
.....11> sideEffect(property(single, 'age',
24)).constant([:])).
.....12> id()
==>v-3
gremlin> g.V().valueMap(true)
==>[id:v-2,label:Person,email:[[email protected]],age:[24]]
==>[id:v-1,label:Person,email:[[email protected]],age:[23]]
==>[id:v-3,label:Person,email:[[email protected]],age:[14]]
gremlin> {code}
The query seems to be both updating values in the incorrect vertices as well as
leaving some values unchanged.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)