Uploaded image for project: 'TinkerPop'
  1. TinkerPop
  2. TINKERPOP-2863

HasId Step generates incorrect results when given a list of IDs mid-traversal

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Fixed
    • 3.6.2
    • 3.7.0, 3.6.3, 3.5.6
    • process
    • None

    Description

      In most situations, hasId() will accept a list of potential IDs to filter on and implicitly use within() filtering semantics to return the correct results.  Examples:

      g.V().hasId(['1','2'])
      

      returns:

      [v[1], v[2]]

      or

      g.E().hasId(['5140','5261'])

      returns:

      [e[5140][1-route->51], e[5261][1-route->398]]

      However, when using the same form of semantics mid-traversal, both of these queries return empty results:

      g.V().has('code','ATL').outE('route').hasId(['5140','5261'])
      g.V().has('code','ATL').outE('route').inV().hasId(['2','3'])
      

      When using profile() against both queries, the hasId() bytecode gets transformed into

      HasStep([~id.eq([5140, 5261])]) 

      This equates to finding a vertex or edge with an ID that matches the entire list instead of the elements within the list.

      The preceding was tested against Gremlin Server 3.6.2 with the Airroutes dataset.

      Attachments

        Issue Links

          Activity

            People

              xiazcy Yang Xia
              Riggan Taylor Riggan
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: