You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hugegraph.apache.org by "javeme (via GitHub)" <gi...@apache.org> on 2023/03/10 14:21:18 UTC

[GitHub] [incubator-hugegraph] javeme commented on issue #2157: [Bug] Query partitioning return false results

javeme commented on issue #2157:
URL: https://github.com/apache/incubator-hugegraph/issues/2157#issuecomment-1463873209

   Because `not(inside(0.5804740550941045,0.45305711119170766)`, that's `vp0.or(lte(0.5804740550941045), gte(0.45305711119170766))` will be split 2 subquery, and they may produce duplicate results.
   
   please try `explain()`:
   `g.V().has('vp0', not(inside(0.5804740550941045,0.45305711119170766))).explain()`
   
   The root cause is the illegal conditions in `inside()`, it's ok if query with `inside(0.4, 0.5)`:
   ```java
   g.V().count() // 10
   g.V().has('vp0', inside(0.4, 0.5)).count() // 2
   g.V().has('vp0', not(inside(0.4, 0.5))).count() // 3
   g.V().hasNot('vp0').count() // 5
   
   ```
   
   gremlin sample:
   ```java
   g.addV('vl1').property('vp2', 5574433807181218360)
   .addV('vl2').property('vp1', 6734362169804229224)
   .addV('vl0').property('vp0', 0.6329616125435166)
   .addV('vl0').property('vp0', 0.6329616125435166)
   .addV('vl2').property('vp1', 5309446427344485779)
   .addV('vl2').property('vp1', -3558853306979155692)
   .addV('vl2').property('vp1', -8943982883114759437)
   .addV('vl1').property('vp0', 0.16393365972677754).property('vp2', 7817799776452691691)
   .addV('vl1').property('vp0', 0.4210924705367233)
   .addV('vl1').property('vp0', 0.47655165657875387)
   
   g.V().count() // 10
   g.V().has('vp0', inside(0.5804740550941045,0.45305711119170766)).count() // 0
   g.V().has('vp0', not(inside(0.5804740550941045,0.45305711119170766))).count() // 6
   g.V().hasNot('vp0').count() // 5
   
   list1=g.V().hasNot('vp0').id().map{it.get().toString()}.toList()
   list2=g.V().has('vp0', not(inside(0.5804740550941045,0.45305711119170766))).id().map{it.get().toString()}.toList()
   [list1,list2]
   
   g.V().has('vp0', not(inside(0.5804740550941045,0.45305711119170766))).explain()
   ```


-- 
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: dev-unsubscribe@hugegraph.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org