Skip to content

[BUG] Merged query using operator MATCH returns false results #942

@llooFlashooll

Description

@llooFlashooll

We discovered a bug that Merged query using operator MATCH returns false results.

  • ArcadeDB Version: 22.12.1
  • Operating system: macOS 13.2.1
  • JDK Version: 11
  • API/Driver: Java

Expected behavior:

We construct the following scenario: we randomly generate two queries Q1, Q2, and merge these two queries using MATCH operator into a new query Q3. Based on the intersection calculation. The Q3 query result set should be the intersection of result sets from Q1 and Q2. We generate the intersection queries based on the reference here: https://stackoverflow.com/questions/48067834/gremlin-intersection-operation. This also a correction of syntax of the #928.
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('vp0') returns [#41:199, #44:199, #47:198, #59:195, #62:194, #65:244, #68:244, #83:239, #86:239]
  2. g.V().in('el1').has('vp2') returns [#62:194]
  3. g.V().match(__.as('a').has('vp0'),__.as('a').in('el1').has('vp2')).select('a') returns [#83:239].

We calculate the intersection result set of Q1 and Q2, which is [#62:194].
The intersection result set doesn't equal to Q3 result set.

Actual behavior:

The intersection 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:

We create a graph with 10 nodes and 20 edges. We try to make it clear to reproduce the bugs, hope to not cause much inconvenience to your reviewing, but we believe the problem does exist.
Following the following graph data generation query, we can reproduce the bugs:

  • Create data
Vertex:
g.addV('vl1').property('vp0','-4326052370286823505').property('vp2','4748443017597012372').property(T.id,#83:239)
g.addV('vl2').property('vp0','-4462472793860383914').property('vp2','3161320056528493163').property(T.id,#59:195)
g.addV('vl1').property('vp0','8798413568155499492').property('vp2','3914684363611490906').property(T.id,#86:239)
g.addV('vl2').property('vp0','8502107583557457183').property('vp2','2586947228952672147').property(T.id,#62:194)
g.addV('vl1').property('vp0','8637981445770599750').property('vp2','6898848238312254540').property(T.id,#65:244)
g.addV('vl2').property('vp0','991762968980711929').property(T.id,#41:199)
g.addV('vl1').property('vp0','-438840506284917553').property('vp2','-364801651085403299').property(T.id,#68:244)
g.addV('vl0').property('vp2','-4053975336427718699').property(T.id,#161:280)
g.addV('vl2').property('vp0','6381142979155028868').property('vp2','-6854451934581924799').property(T.id,#44:199)
g.addV('vl2').property('vp0','-2994676344083264213').property('vp2','7527951846231647692').property(T.id,#47:198)

Edge:
g.V(#65:244).as('#65:244').V(#86:239).as('#86:239').addE('el0').from('#65:244').to('#86:239')
g.V(#62:194).as('#62:194').V(#161:280).as('#161:280').addE('el2').from('#62:194').to('#161:280')
g.V(#83:239).as('#83:239').V(#62:194).as('#62:194').addE('el1').from('#83:239').to('#62:194')
g.V(#41:199).as('#41:199').V(#62:194).as('#62:194').addE('el3').from('#41:199').to('#62:194')
g.V(#65:244).as('#65:244').V(#41:199).as('#41:199').addE('el1').from('#65:244').to('#41:199')
g.V(#47:198).as('#47:198').V(#62:194).as('#62:194').addE('el3').from('#47:198').to('#62:194')
g.V(#68:244).as('#68:244').V(#41:199).as('#41:199').addE('el1').from('#68:244').to('#41:199')
g.V(#44:199).as('#44:199').V(#161:280).as('#161:280').addE('el2').from('#44:199').to('#161:280')
g.V(#47:198).as('#47:198').V(#161:280).as('#161:280').addE('el2').from('#47:198').to('#161:280')
g.V(#41:199).as('#41:199').V(#161:280).as('#161:280').addE('el2').from('#41:199').to('#161:280')
g.V(#59:195).as('#59:195').V(#161:280).as('#161:280').addE('el2').from('#59:195').to('#161:280')
g.V(#83:239).as('#83:239').V(#68:244).as('#68:244').addE('el0').from('#83:239').to('#68:244')
g.V(#68:244).as('#68:244').V(#83:239).as('#83:239').addE('el0').from('#68:244').to('#83:239')
g.V(#44:199).as('#44:199').V(#62:194).as('#62:194').addE('el3').from('#44:199').to('#62:194')
g.V(#44:199).as('#44:199').V(#41:199).as('#41:199').addE('el3').from('#44:199').to('#41:199')
g.V(#41:199).as('#41:199').V(#47:198).as('#47:198').addE('el3').from('#41:199').to('#47:198')
g.V(#86:239).as('#86:239').V(#41:199).as('#41:199').addE('el1').from('#86:239').to('#41:199')
g.V(#68:244).as('#68:244').V(#68:244).as('#68:244').addE('el0').from('#68:244').to('#68:244')
g.V(#65:244).as('#65:244').V(#65:244).as('#65:244').addE('el0').from('#65:244').to('#65:244')
g.V(#62:194).as('#62:194').V(#44:199).as('#44:199').addE('el3').from('#62:194').to('#44:199')

Metadata

Metadata

Assignees

Labels

questionFurther information is requested

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions