llooFlashooll opened a new issue, #2155: URL: https://github.com/apache/incubator-hugegraph/issues/2155
### Bug Type (问题类型) gremlin (结果不合预期) ### Before submit - [X] 我已经确认现有的 [Issues](https://github.com/apache/hugegraph/issues) 与 [FAQ](https://hugegraph.apache.org/docs/guides/faq/) 中没有相同 / 重复问题 (I have confirmed and searched that there are no similar problems in the historical issue and documents) ### Environment (环境信息) - HugeGraph Version: 0.12.0 - Storage Backend: inmemory - Mixed Index Backend: none - Link to discussed bug: none - Operating system: macOS 13.2.1 - API/Driver: Java ### Expected & Actual behavior (期望与实际表现) - Expected behavior: We construct the following scenario: we randomly generate two queries Q1, Q2, and merge these two queries using OR logical operator into a new query Q3. Based on the OR 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('vp0').has('vp3',-365852096)` returns `[698919952991649792]` 2) `g.V().hasNot('vp0')` returns `[698919952974872576, 698919952974872576, 698919952991649792, 698919953046175744, 698919953046175744, 698919953062952960, 698919953062952960]` 3) `g.V().or(has('vp0').has('vp3',-365852096),hasNot('vp0'))` returns **an empty set**. We calculate the union result set of Q1 and Q2, which is `[698919952974872576, 698919952974872576, 698919952991649792, 698919953046175744, 698919953046175744, 698919953062952960, 698919953062952960]`. 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. This might be a duplicate of #2153 but the query and logical operator are different so I reported it just in case. ### Vertex/Edge example (问题点 / 边数据举例) ```javascript - 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','1').property('vp2','-6562388087035219569').property(T.id,698919952907763712) g.addV('vl0').property('vp0','1858251977').property(T.id,698919952937123840) g.addV('vl0').property('vp0','1858251977').property(T.id,698919952958095360) g.addV('vl1').property('vp3','-365852096').property(T.id,698919952974872576) g.addV('vl1').property('vp0','-1469734422').property('vp3','-365852096').property('vp2','-8992484234854836964').property(T.id,698919952991649792) g.addV('vl0').property('vp0','-365852096').property(T.id,698919953012621312) g.addV('vl1').property('vp0','-1469734422').property('vp3','1858251977').property('vp2','-174590550134364412').property(T.id,698919953029398528) g.addV('vl1').property('vp2','-4956994369326472437').property(T.id,698919953046175744) g.addV('vl1').property('vp2','-3722527400614334801').property(T.id,698919953062952960) g.addV('vl0').property('vp0','1858251977').property(T.id,698919953079730176) Edge: g.V(698919953029398528).as('698919953029398528').V(698919952974872576).as('698919952974872576').addE('el0').from('698919953029398528').to('698919952974872576') g.V(698919952907763712).as('698919952907763712').V(698919953046175744).as('698919953046175744').addE('el0').from('698919952907763712').to('698919953046175744') g.V(698919952974872576).as('698919952974872576').V(698919953029398528).as('698919953029398528').addE('el0').from('698919952974872576').to('698919953029398528') g.V(698919953046175744).as('698919953046175744').V(698919952907763712).as('698919952907763712').addE('el0').from('698919953046175744').to('698919952907763712') g.V(698919952907763712).as('698919952907763712').V(698919952907763712).as('698919952907763712').addE('el0').from('698919952907763712').to('698919952907763712') g.V(698919953062952960).as('698919953062952960').V(698919953046175744).as('698919953046175744').addE('el0').from('698919953062952960').to('698919953046175744') g.V(698919952974872576).as('698919952974872576').V(698919952991649792).as('698919952991649792').addE('el0').from('698919952974872576').to('698919952991649792') g.V(698919952991649792).as('698919952991649792').V(698919953046175744).as('698919953046175744').addE('el0').from('698919952991649792').to('698919953046175744') g.V(698919952907763712).as('698919952907763712').V(698919952991649792).as('698919952991649792').addE('el0').from('698919952907763712').to('698919952991649792') g.V(698919952991649792).as('698919952991649792').V(698919952991649792).as('698919952991649792').addE('el0').from('698919952991649792').to('698919952991649792') g.V(698919952991649792).as('698919952991649792').V(698919953029398528).as('698919953029398528').addE('el0').from('698919952991649792').to('698919953029398528') g.V(698919953029398528).as('698919953029398528').V(698919952907763712).as('698919952907763712').addE('el0').from('698919953029398528').to('698919952907763712') g.V(698919953046175744).as('698919953046175744').V(698919953062952960).as('698919953062952960').addE('el0').from('698919953046175744').to('698919953062952960') g.V(698919952991649792).as('698919952991649792').V(698919952974872576).as('698919952974872576').addE('el0').from('698919952991649792').to('698919952974872576') g.V(698919952974872576).as('698919952974872576').V(698919952907763712).as('698919952907763712').addE('el0').from('698919952974872576').to('698919952907763712') g.V(698919953029398528).as('698919953029398528').V(698919953062952960).as('698919953062952960').addE('el0').from('698919953029398528').to('698919953062952960') g.V(698919953046175744).as('698919953046175744').V(698919953029398528).as('698919953029398528').addE('el0').from('698919953046175744').to('698919953029398528') g.V(698919953062952960).as('698919953062952960').V(698919953062952960).as('698919953062952960').addE('el0').from('698919953062952960').to('698919953062952960') g.V(698919952974872576).as('698919952974872576').V(698919953062952960).as('698919953062952960').addE('el0').from('698919952974872576').to('698919953062952960') g.V(698919953029398528).as('698919953029398528').V(698919953046175744).as('698919953046175744').addE('el0').from('698919953029398528').to('698919953046175744') ``` ``` ### Schema [VertexLabel, EdgeLabel, IndexLabel] (元数据结构) ```javascript - Create schema schema().propertyKey('vp0').asInt().ifNotExist().create(); schema().propertyKey('vp1').asLong().ifNotExist().create(); schema().propertyKey('vp2').asLong().ifNotExist().create(); schema().propertyKey('vp3').asInt().ifNotExist().create(); schema().vertexLabel('vl0').ifNotExist().create(); schema().vertexLabel('vl0').properties('vp0').nullableKeys('vp0').append(); schema().indexLabel('vl0byvp0Shard').onV('vl0').by('vp0').shard().ifNotExist().create(); schema().vertexLabel('vl1').ifNotExist().create(); schema().vertexLabel('vl1').properties('vp0').nullableKeys('vp0').append(); schema().indexLabel('vl1byvp0Shard').onV('vl1').by('vp0').shard().ifNotExist().create(); schema().vertexLabel('vl1').properties('vp3').nullableKeys('vp3').append(); schema().indexLabel('vl1byvp3Shard').onV('vl1').by('vp3').shard().ifNotExist().create(); schema().vertexLabel('vl1').properties('vp2').nullableKeys('vp2').append(); schema().indexLabel('vl1byvp2Shard').onV('vl1').by('vp2').shard().ifNotExist().create(); schema().propertyKey('ep0').asDouble().ifNotExist().create(); schema().propertyKey('ep1').asInt().ifNotExist().create(); schema().propertyKey('ep2').asDouble().ifNotExist().create(); schema().propertyKey('ep3').asText().ifNotExist().create(); schema().propertyKey('ep4').asBoolean().ifNotExist().create(); schema().propertyKey('ep5').asFloat().ifNotExist().create(); schema().edgeLabel('el0').link('vl1', 'vl1').ifNotExist().create(); schema().edgeLabel('el0').properties('ep0').nullableKeys('ep0').append(); schema().indexLabel('el0byep0Shard').onE('el0').by('ep0').shard().ifNotExist().create(); schema().edgeLabel('el0').properties('ep4').nullableKeys('ep4').append(); schema().indexLabel('el0byep4Shard').onE('el0').by('ep4').shard().ifNotExist().create(); schema().edgeLabel('el0').properties('ep2').nullableKeys('ep2').append(); schema().indexLabel('el0byep2Shard').onE('el0').by('ep2').shard().ifNotExist().create(); ``` ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
