You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tinkerpop.apache.org by "Florin Mihaila (JIRA)" <ji...@apache.org> on 2016/09/29 19:52:20 UTC

[jira] [Created] (TINKERPOP-1484) Bad interaction of long-typed vertex properties with TinkerGraph indexes

Florin Mihaila created TINKERPOP-1484:
-----------------------------------------

             Summary: Bad interaction of long-typed vertex properties with TinkerGraph indexes
                 Key: TINKERPOP-1484
                 URL: https://issues.apache.org/jira/browse/TINKERPOP-1484
             Project: TinkerPop
          Issue Type: Bug
          Components: tinkergraph
    Affects Versions: 3.2.2, 3.2.3
         Environment: macOS Sierra (v10.12), jdk 1.8.0_102-b14 
            Reporter: Florin Mihaila


    In graphs with indexed properties, queries fail on certain vertices (but not all) with properties of type long.
    
    The following code reproduces the bug:
    
    {noformat}
    $ cat bug.groovy
    graph = TinkerGraph.open() 
    graph.createIndex('other', Vertex.class) // (A)
    graph.createIndex('prop', Vertex.class)  // (B)
      
    v = graph.addVertex()
    v.property('prop', (long)1)
    v.property('other', 0)
      
    v = graph.addVertex()
    v.property('prop', 12345678910)
    v.property('other', 1)
  
    g = graph.traversal()
    {noformat}
    
    The verbatim console session:
      
    {noformat}
    $ bin/gremlin.sh bug.groovy
      
             \,,,/
             (o o)
    -----oOOo-(3)-oOOo-----
    plugin activated: tinkerpop.server
    plugin activated: tinkerpop.utilities
    plugin activated: tinkerpop.tinkergraph
    gremlin> g.V().valueMap()
    ==>[other:[0],prop:[1]]
    ==>[other:[1],prop:[12345678910]]
    gremlin> g.V().has('prop', 1)   // (1)
    gremlin> g.V().has('other', 0).has('prop', 1) // (2)
    ==>v[0]    
    gremlin> g.V().has('prop', 12345678910) // (3)
    ==>v[3]
    gremlin> 
      
    {noformat}  
      
    Observations:
    1. The node is not found, although it's there.
    2. The node _is_ found as long as the graph is queried of another indexed property first.
    3. The node _is_ found if the property value is wider than an int.
    
    Variations:
    v1. If the 'other' property is not indexed (line A), query (2) fails.
    v2. If the 'prop' property is not indexed (line B), all queries succeed!
      
    Tested on freshly built tinkerpop distributions, versions 3.2.2 and 3.2.3.




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)