You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tinkerpop.apache.org by "Daniel Kuppitz (JIRA)" <ji...@apache.org> on 2017/02/09 22:58:41 UTC

[jira] [Created] (TINKERPOP-1626) choose() is buggy in OLAP

Daniel Kuppitz created TINKERPOP-1626:
-----------------------------------------

             Summary: choose() is buggy in OLAP
                 Key: TINKERPOP-1626
                 URL: https://issues.apache.org/jira/browse/TINKERPOP-1626
             Project: TinkerPop
          Issue Type: Bug
          Components: process
    Affects Versions: 3.3.0
            Reporter: Daniel Kuppitz


Not yet tested in older versions.

What follows are two queries that only differ in where {{as("p2").select("p1","p2")}} is done. {{p1}} is a person and {{p2}} is (supposed to be) either a person known by {{p1}} or - if {{p1}} doesn't know anybody - the same as {{p1}}.

*OLTP (all good):*
{noformat}
gremlin> g = TinkerFactory.createModern().traversal()
==>graphtraversalsource[tinkergraph[vertices:6 edges:6], standard]
gremlin> g.V().hasLabel("person").as("p1").choose(outE("knows"), out("knows"), identity()).as("p2").select("p1","p2")
==>[p1:v[1],p2:v[2]]
==>[p1:v[1],p2:v[4]]
==>[p1:v[2],p2:v[2]]
==>[p1:v[4],p2:v[4]]
==>[p1:v[6],p2:v[6]]
gremlin> g.V().hasLabel("person").as("p1").choose(outE("knows"), out("knows").as("p2").select("p1","p2"), __.as("p2").select("p1","p2"))
==>[p1:v[1],p2:v[2]]
==>[p1:v[1],p2:v[4]]
==>[p1:v[2],p2:v[2]]
==>[p1:v[4],p2:v[4]]
==>[p1:v[6],p2:v[6]]
{noformat}

*OLAP (only works when {{select()}} is done twice - once for each branch):*

{noformat}
gremlin> g = g.withComputer()
==>graphtraversalsource[tinkergraph[vertices:6 edges:6], graphcomputer]
gremlin> g.V().hasLabel("person").as("p1").choose(outE("knows"), out("knows"), identity()).as("p2").select("p1","p2")
==>[p1:v[1],p2:v[1]]
==>[p1:v[1],p2:v[1]]
gremlin> g.V().hasLabel("person").as("p1").choose(outE("knows"), out("knows").as("p2").select("p1","p2"), __.as("p2").select("p1","p2"))
==>[p1:v[2],p2:v[2]]
==>[p1:v[4],p2:v[4]]
==>[p1:v[6],p2:v[6]]
==>[p1:v[1],p2:v[2]]
==>[p1:v[1],p2:v[4]]
{noformat}



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)