You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tinkerpop.apache.org by "Stephen Mallette (Jira)" <ji...@apache.org> on 2021/11/04 12:38:00 UTC

[jira] [Created] (TINKERPOP-2642) Comparability for NaN and nulltype

Stephen Mallette created TINKERPOP-2642:
-------------------------------------------

             Summary: Comparability for NaN and nulltype
                 Key: TINKERPOP-2642
                 URL: https://issues.apache.org/jira/browse/TINKERPOP-2642
             Project: TinkerPop
          Issue Type: Improvement
          Components: process
    Affects Versions: 3.5.1
            Reporter: Stephen Mallette


* Comparing on {{NaN}} should return no results.
* Comparability throws exception today but should return {{nulltype}} when comparing incompatible types.
** When Vertex /Edge/VertexProperty  is compared, today it throws but it should return {{nulltype}}.
** When {{nulltype}} is compared, today it throws an exception but it should return {{nulltype}} 

{code}
gremlin> g.addV().property('key',-5)
==>v[0]
gremlin> g.addV().property('key',0)
==>v[2]
gremlin> g.addV().property('key',5)
==>v[4]
gremlin> g.addV().property('key',Double.NaN)
==>v[6]
gremlin> g.V().values("key").is(lte(Double.NaN)) // 3.5.x
==>-5
==>0
==>NaN
gremlin> g.V().values("key").is(gte(Double.NaN)) // 3.5.x
==>0
==>5
==>NaN
gremlin> g.V().values("key").is(lt(Double.NaN)) // 3.5.x
==>-5
gremlin> g.V().values("key").is(gt(Double.NaN)) // 3.5.x
==>5
gremlin> g.V().values("key").is(lte(Double.NaN)) // proposed
==>NaN
gremlin> g.V().values("key").is(gte(Double.NaN)) // proposed
==>NaN
gremlin> g.V().values("key").is(lte(Double.NaN)) // proposed
gremlin> g.V().values("key").is(gte(Double.NaN)) // proposed
{code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)