Re: [BUG] Merged query using logical operator OR returns false results
Flash
Dear developers, I re-corrected the syntax and ran new experiments, still triggered the bugs.
### Expected behavior:
We construct the following scenario: we randomly generate two queries Q1, Q2, and merge these two queries using UNION operator into a new query Q3. See reference at https://tinkerpop.apache.org/docs/current/reference/#union-step. Based on the calculation. The Q3 query result set should be the union of result sets from Q1 and Q2.
We generate graph schema and data based on random strings and values. Here is one of our examples that triggered the bug.
1. `g.V().has('vp3',0.096218884).and(__.values('vp3')).dedup()` returns `[4104]]`.
2. `g.V().has('vl1', 'vp0',neq(1837432504)).dedup()` returns `[12352, 4120, 4160, 8256]`.
3. `g.V().union(__.has('vp3',0.096218884).and(__.values('vp3')).dedup(),__.has('vl1', 'vp0',neq(1837432504)).dedup()).dedup()` returns `[12352, 4120, 4160, 8256]`.
We calculate the union result set of Q1 and Q2, which is `[12352, 4104, 4120, 4160, 8256]`.
The union result set doesn't equal to Q3 result set.
### Actual behavior:
The union result set should equal to Q3 result set. We did trigger some cases conform to this requirement, but still there're some cases that violate this constraint.
### Steps to reproduce
Create data
``` data
Vertex:
g.addV('vl0').property('vp3','0.07635844').property('vp2','-1253153106882140636').property(T.id,4112)
g.addV('vl1').property('vp0','-2008883833').property('vp4','-1175010975').property(T.id,4160)
g.addV('vl1').property('vp1','7263845879243599376').property('vp0','-2027833781').property('vp4','-2008883833').property(T.id,8256)
g.addV('vl1').property('vp1','-243995170435985954').property('vp0','-723752269').property(T.id,4120)
g.addV('vl0').property('vp3','0.7607715').property('vp2','1317863491439683413').property(T.id,4296)
g.addV('vl0').property('vp3','0.096218884').property('vp2','-5937605049120030789').property(T.id,4104)
g.addV('vl1').property('vp0','-801622318').property('vp4','-1549232059').property(T.id,12352)
g.addV('vl0').property('vp3','0.6184602').property(T.id,8216)
g.addV('vl1').property('vp1','-3321205565666288421').property('vp4','-205678910').property(T.id,4232)
g.addV('vl0').property('vp3','0.76833284').property('vp2','8093816432935448112').property(T.id,4168)
Edge:
g.V(4120).as('4120').V(4160).as('4160').addE('el2').from('4120').to('4160')
g.V(12352).as('12352').V(8256).as('8256').addE('el2').from('12352').to('8256')
g.V(4120).as('4120').V(8256).as('8256').addE('el2').from('4120').to('8256')
g.V(4232).as('4232').V(8256).as('8256').addE('el2').from('4232').to('8256')
g.V(4120).as('4120').V(8256).as('8256').addE('el1').from('4120').to('8256')
g.V(8256).as('8256').V(12352).as('12352').addE('el1').from('8256').to('12352')
g.V(4232).as('4232').V(8256).as('8256').addE('el1').from('4232').to('8256')
g.V(4120).as('4120').V(12352).as('12352').addE('el1').from('4120').to('12352')
g.V(12352).as('12352').V(12352).as('12352').addE('el2').from('12352').to('12352')
g.V(4120).as('4120').V(4232).as('4232').addE('el2').from('4120').to('4232')
g.V(4232).as('4232').V(4232).as('4232').addE('el2').from('4232').to('4232')
g.V(8256).as('8256').V(4120).as('4120').addE('el1').from('8256').to('4120')
g.V(4112).as('4112').V(4232).as('4232').addE('el0').from('4112').to('4232')
g.V(4296).as('4296').V(12352).as('12352').addE('el0').from('4296').to('12352')
g.V(4104).as('4104').V(4232).as('4232').addE('el0').from('4104').to('4232')
g.V(8256).as('8256').V(4160).as('4160').addE('el2').from('8256').to('4160')
g.V(4160).as('4160').V(4120).as('4120').addE('el2').from('4160').to('4120')
g.V(4112).as('4112').V(12352).as('12352').addE('el0').from('4112').to('12352')
g.V(4168).as('4168').V(4232).as('4232').addE('el0').from('4168').to('4232')
g.V(4120).as('4120').V(12352).as('12352').addE('el2').from('4120').to('12352')
```