llooFlashooll commented on issue #2153:
URL: 
https://github.com/apache/incubator-hugegraph/issues/2153#issuecomment-1471154974

   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 MATCH operator into a new query Q3. See 
reference at 
https://stackoverflow.com/questions/48067834/gremlin-intersection-operation. 
Based on the calculation. The Q3 query result set should be the intersection 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')` returns `[700758216899821568, 700758216933376000, 
700758216950153216, 700758216987901952, 700758217004679168, 700758217034039296, 
700758217067593728, 700758217080176640, 700758217092759552]`.
   2. `g.V().has('vp1').out('el0','el2','el1')` returns `[700758216899821568, 
700758216933376000, 700758216950153216, 700758216987901952, 700758217004679168, 
700758217034039296, 700758217080176640, 700758217092759552]`.
   3. 
`g.V().match(__.as('a').has('vp3'),__.as('a').has('vp1').out('el0','el2','el1')).select('a')`
 returns `[700758216899821568, 700758216950153216, 700758217034039296, 
700758217067593728, 700758217092759552]`.
   
   We calculate the intersection result set of Q1 and Q2, which is 
`[700758216899821568, 700758216933376000, 700758216950153216, 
700758216987901952, 700758217004679168, 700758217034039296, 700758217080176640, 
700758217092759552]`.
   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
   Create schema
   ```
   schema().propertyKey('vp0').asDouble().ifNotExist().create();
   schema().propertyKey('vp1').asLong().ifNotExist().create();
   schema().propertyKey('vp2').asText().ifNotExist().create();
   schema().propertyKey('vp3').asFloat().ifNotExist().create();
   schema().propertyKey('vp4').asText().ifNotExist().create();
   schema().propertyKey('vp5').asLong().ifNotExist().create();
   schema().propertyKey('vp6').asText().ifNotExist().create();
   schema().vertexLabel('vl0').ifNotExist().create();
   schema().vertexLabel('vl0').properties('vp3').nullableKeys('vp3').append();
   
schema().indexLabel('vl0byvp3Shard').onV('vl0').by('vp3').shard().ifNotExist().create();
   schema().vertexLabel('vl0').properties('vp1').nullableKeys('vp1').append();
   
schema().indexLabel('vl0byvp1Shard').onV('vl0').by('vp1').shard().ifNotExist().create();
   schema().vertexLabel('vl1').ifNotExist().create();
   schema().vertexLabel('vl1').properties('vp3').nullableKeys('vp3').append();
   
schema().indexLabel('vl1byvp3Shard').onV('vl1').by('vp3').shard().ifNotExist().create();
   schema().vertexLabel('vl1').properties('vp0').nullableKeys('vp0').append();
   
schema().indexLabel('vl1byvp0Shard').onV('vl1').by('vp0').shard().ifNotExist().create();
   schema().vertexLabel('vl1').properties('vp1').nullableKeys('vp1').append();
   
schema().indexLabel('vl1byvp1Shard').onV('vl1').by('vp1').shard().ifNotExist().create();
   schema().vertexLabel('vl1').properties('vp2').nullableKeys('vp2').append();
   
schema().indexLabel('vl1byvp2Shard').onV('vl1').by('vp2').shard().ifNotExist().create();
   schema().vertexLabel('vl1').properties('vp5').nullableKeys('vp5').append();
   
schema().indexLabel('vl1byvp5Shard').onV('vl1').by('vp5').shard().ifNotExist().create();
   schema().propertyKey('ep0').asFloat().ifNotExist().create();
   schema().propertyKey('ep1').asInt().ifNotExist().create();
   schema().propertyKey('ep2').asBoolean().ifNotExist().create();
   schema().propertyKey('ep3').asInt().ifNotExist().create();
   schema().propertyKey('ep4').asFloat().ifNotExist().create();
   schema().propertyKey('ep5').asFloat().ifNotExist().create();
   schema().propertyKey('ep6').asText().ifNotExist().create();
   schema().propertyKey('ep7').asInt().ifNotExist().create();
   schema().propertyKey('ep8').asText().ifNotExist().create();
   schema().propertyKey('ep9').asText().ifNotExist().create();
   schema().propertyKey('ep10').asText().ifNotExist().create();
   schema().propertyKey('ep11').asInt().ifNotExist().create();
   schema().propertyKey('ep12').asInt().ifNotExist().create();
   schema().propertyKey('ep13').asText().ifNotExist().create();
   schema().edgeLabel('el0').link('vl0', 'vl1').ifNotExist().create();
   schema().edgeLabel('el0').properties('ep7').nullableKeys('ep7').append();
   
schema().indexLabel('el0byep7Shard').onE('el0').by('ep7').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('ep6').nullableKeys('ep6').append();
   
schema().indexLabel('el0byep6Shard').onE('el0').by('ep6').shard().ifNotExist().create();
   schema().edgeLabel('el0').properties('ep2').nullableKeys('ep2').append();
   
schema().indexLabel('el0byep2Shard').onE('el0').by('ep2').shard().ifNotExist().create();
   schema().edgeLabel('el1').link('vl0', 'vl0').ifNotExist().create();
   schema().edgeLabel('el1').properties('ep1').nullableKeys('ep1').append();
   
schema().indexLabel('el1byep1Shard').onE('el1').by('ep1').shard().ifNotExist().create();
   schema().edgeLabel('el1').properties('ep4').nullableKeys('ep4').append();
   
schema().indexLabel('el1byep4Shard').onE('el1').by('ep4').shard().ifNotExist().create();
   schema().edgeLabel('el1').properties('ep3').nullableKeys('ep3').append();
   
schema().indexLabel('el1byep3Shard').onE('el1').by('ep3').shard().ifNotExist().create();
   schema().edgeLabel('el1').properties('ep5').nullableKeys('ep5').append();
   
schema().indexLabel('el1byep5Shard').onE('el1').by('ep5').shard().ifNotExist().create();
   schema().edgeLabel('el1').properties('ep8').nullableKeys('ep8').append();
   
schema().indexLabel('el1byep8Shard').onE('el1').by('ep8').shard().ifNotExist().create();
   schema().edgeLabel('el1').properties('ep9').nullableKeys('ep9').append();
   
schema().indexLabel('el1byep9Shard').onE('el1').by('ep9').shard().ifNotExist().create();
   schema().edgeLabel('el1').properties('ep11').nullableKeys('ep11').append();
   
schema().indexLabel('el1byep11Shard').onE('el1').by('ep11').shard().ifNotExist().create();
   schema().edgeLabel('el1').properties('ep13').nullableKeys('ep13').append();
   
schema().indexLabel('el1byep13Shard').onE('el1').by('ep13').shard().ifNotExist().create();
   schema().edgeLabel('el1').properties('ep0').nullableKeys('ep0').append();
   
schema().indexLabel('el1byep0Shard').onE('el1').by('ep0').shard().ifNotExist().create();
   schema().edgeLabel('el1').properties('ep6').nullableKeys('ep6').append();
   
schema().indexLabel('el1byep6Shard').onE('el1').by('ep6').shard().ifNotExist().create();
   schema().edgeLabel('el2').link('vl0', 'vl0').ifNotExist().create();
   schema().edgeLabel('el2').properties('ep13').nullableKeys('ep13').append();
   
schema().indexLabel('el2byep13Shard').onE('el2').by('ep13').shard().ifNotExist().create();
   schema().edgeLabel('el2').properties('ep9').nullableKeys('ep9').append();
   
schema().indexLabel('el2byep9Shard').onE('el2').by('ep9').shard().ifNotExist().create();
   schema().edgeLabel('el2').properties('ep3').nullableKeys('ep3').append();
   
schema().indexLabel('el2byep3Shard').onE('el2').by('ep3').shard().ifNotExist().create();
   schema().edgeLabel('el2').properties('ep10').nullableKeys('ep10').append();
   
schema().indexLabel('el2byep10Shard').onE('el2').by('ep10').shard().ifNotExist().create();
   schema().edgeLabel('el2').properties('ep12').nullableKeys('ep12').append();
   
schema().indexLabel('el2byep12Shard').onE('el2').by('ep12').shard().ifNotExist().create();
   schema().edgeLabel('el2').properties('ep5').nullableKeys('ep5').append();
   
schema().indexLabel('el2byep5Shard').onE('el2').by('ep5').shard().ifNotExist().create();
   schema().edgeLabel('el2').properties('ep7').nullableKeys('ep7').append();
   
schema().indexLabel('el2byep7Shard').onE('el2').by('ep7').shard().ifNotExist().create();
   schema().edgeLabel('el2').properties('ep6').nullableKeys('ep6').append();
   
schema().indexLabel('el2byep6Shard').onE('el2').by('ep6').shard().ifNotExist().create();
   ```
   
   Create data
   ```
   Vertex:
   
g.addV('vl0').property('vp1','6077096360517822774').property('vp3','0.40865815').property(T.id,700758216899821568)
   
g.addV('vl1').property('vp1','-3105097121239014869').property('vp0','0.9602485230195713').property('vp3','0.11201912').property('vp2',''hkh,煵'').property('vp5','-2210934055481158448').property(T.id,700758216933376000)
   
g.addV('vl0').property('vp1','608648493074836329').property('vp3','0.8847752').property(T.id,700758216950153216)
   
g.addV('vl1').property('vp1','5981465538825897670').property('vp0','2.64728949E8').property('vp3','0.77093786').property('vp2',''264728949'').property('vp5','-3413988033556365072').property(T.id,700758216987901952)
   
g.addV('vl1').property('vp1','7811225373624447078').property('vp0','0.7579648223931974').property('vp3','0.1915425').property(T.id,700758217004679168)
   
g.addV('vl0').property('vp1','2634736745791447301').property(T.id,700758217017262080)
   
g.addV('vl0').property('vp1','4995825654042474383').property('vp3','0.18568856').property(T.id,700758217034039296)
   
g.addV('vl0').property('vp1','-7408086936656942203').property('vp3','0.30286366').property(T.id,700758217067593728)
   
g.addV('vl1').property('vp3','0.5910341').property('vp5','-1266268274840835817').property(T.id,700758217080176640)
   
g.addV('vl0').property('vp1','1143854917761440004').property('vp3','0.56839806').property(T.id,700758217092759552)
   Edge:
   
g.V(700758217080176640).as('700758217080176640').V(700758217092759552).as('700758217092759552').addE('el0').from('700758217080176640').to('700758217092759552')
   
g.V(700758216950153216).as('700758216950153216').V(700758216950153216).as('700758216950153216').addE('el1').from('700758216950153216').to('700758216950153216')
   
g.V(700758216950153216).as('700758216950153216').V(700758217017262080).as('700758217017262080').addE('el1').from('700758216950153216').to('700758217017262080')
   
g.V(700758216933376000).as('700758216933376000').V(700758217067593728).as('700758217067593728').addE('el0').from('700758216933376000').to('700758217067593728')
   
g.V(700758217034039296).as('700758217034039296').V(700758216899821568).as('700758216899821568').addE('el2').from('700758217034039296').to('700758216899821568')
   
g.V(700758216950153216).as('700758216950153216').V(700758217034039296).as('700758217034039296').addE('el2').from('700758216950153216').to('700758217034039296')
   
g.V(700758217092759552).as('700758217092759552').V(700758217034039296).as('700758217034039296').addE('el2').from('700758217092759552').to('700758217034039296')
   
g.V(700758217034039296).as('700758217034039296').V(700758217092759552).as('700758217092759552').addE('el2').from('700758217034039296').to('700758217092759552')
   
g.V(700758216899821568).as('700758216899821568').V(700758217092759552).as('700758217092759552').addE('el2').from('700758216899821568').to('700758217092759552')
   
g.V(700758217004679168).as('700758217004679168').V(700758217067593728).as('700758217067593728').addE('el0').from('700758217004679168').to('700758217067593728')
   
g.V(700758216987901952).as('700758216987901952').V(700758217067593728).as('700758217067593728').addE('el0').from('700758216987901952').to('700758217067593728')
   
g.V(700758217092759552).as('700758217092759552').V(700758217092759552).as('700758217092759552').addE('el2').from('700758217092759552').to('700758217092759552')
   
g.V(700758217092759552).as('700758217092759552').V(700758217067593728).as('700758217067593728').addE('el1').from('700758217092759552').to('700758217067593728')
   
g.V(700758216987901952).as('700758216987901952').V(700758217092759552).as('700758217092759552').addE('el0').from('700758216987901952').to('700758217092759552')
   
g.V(700758217004679168).as('700758217004679168').V(700758216899821568).as('700758216899821568').addE('el0').from('700758217004679168').to('700758216899821568')
   
g.V(700758216987901952).as('700758216987901952').V(700758216950153216).as('700758216950153216').addE('el0').from('700758216987901952').to('700758216950153216')
   
g.V(700758216899821568).as('700758216899821568').V(700758217017262080).as('700758217017262080').addE('el2').from('700758216899821568').to('700758217017262080')
   
g.V(700758216950153216).as('700758216950153216').V(700758216899821568).as('700758216899821568').addE('el1').from('700758216950153216').to('700758216899821568')
   
g.V(700758216899821568).as('700758216899821568').V(700758217092759552).as('700758217092759552').addE('el1').from('700758216899821568').to('700758217092759552')
   
g.V(700758216933376000).as('700758216933376000').V(700758216899821568).as('700758216899821568').addE('el0').from('700758216933376000').to('700758216899821568')
   ```


-- 
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]

Reply via email to