zhengyingying opened a new issue, #2135: URL: https://github.com/apache/incubator-hugegraph/issues/2135
### 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 (环境信息) - Server Version: 1.0.0 (Apache Release Version) - Backend: in memory - OS: xx CPUs, xx G RAM, Ubuntu 2x.x / CentOS 7.x - Data Size: xx vertices, xx edges <!-- (like 1000W 点, 9000W 边) --> ### Expected & Actual behavior (期望与实际表现) I compare a counted value with a predicate `gt(-3)`. Since the counted value should be larger or equal to 0, I think HugeGraph can still compare the counted value with a negative value, e.g., `gt(-3)`. But, it throws an exception. However, if I remove the CountStrategy, or compare with a negtiva value `-2` or `-1` (like [HugeGraph#2133](https://github.com/apache/incubator-hugegraph/issues/2133)), I can get the expected result. ``` gremlin> :> g.V().where(__.in('teach').count().is(gt(-3))) java.lang.IllegalArgumentException: Not a legal range: [0, -2] gremlin> :> g.withoutStrategies(CountStrategy.class).V().where(__.in('teach').count().is(gt(-3))) ==>[id:695284911031975936,label:person,type:vertex,properties:[age:12]] ==>[id:695284911036170241,label:person,type:vertex,properties:[age:24]] ==>[id:695284911036170240,label:person,type:vertex,properties:[age:23]] gremlin> :> g.V().where(__.in('teach').count().is(gt(-2))) ==>[id:695284911031975936,label:person,type:vertex,properties:[age:12]] ==>[id:695284911036170241,label:person,type:vertex,properties:[age:24]] ==>[id:695284911036170240,label:person,type:vertex,properties:[age:23]] ``` The example consists of three vertices and two edges. ``` Vertex person1 = new Vertex("person").property("age", 12); Vertex person2 = new Vertex("person").property("age", 23); Vertex person3 = new Vertex("person").property("age", 24); Edge edge1 = new Edge("knows").source(person2).target(person1).property("year", 1); Edge edge2 = new Edge("teach").source(person3).target(person1).property("year", 2); ``` ### Vertex/Edge example (问题点 / 边数据举例) _No response_ ### Schema [VertexLabel, EdgeLabel, IndexLabel] (元数据结构) _No response_ -- 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-unsubscr...@hugegraph.apache.org.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org