[ https://issues.apache.org/jira/browse/TINKERPOP-1762?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16146206#comment-16146206 ]
ASF GitHub Bot commented on TINKERPOP-1762: ------------------------------------------- GitHub user okram opened a pull request: https://github.com/apache/tinkerpop/pull/701 TINKERPOP-1762: Make MatchStep analyze mid-clause variables for executing ordering purposes. https://issues.apache.org/jira/browse/TINKERPOP-1762 There was a bug in `MatchStep` where if you had a mid-clause `where()`, its variable was not being considered as part of the determination of the matching start-variables. This led to traversers going down clause paths when they didn't have all the subsequent data. ``` gremlin> graph = TinkerGraph.open() ==>tinkergraph[vertices:0 edges:0] gremlin> graph.io(graphml()).readGraph("data/grateful-dead.xml") ==>null gremlin> g = graph.traversal() ==>graphtraversalsource[tinkergraph[vertices:808 edges:8049], standard] gremlin> g.V().match( ......1> __.as("sunshine").has("song", "name", "HERE COMES SUNSHINE"), ......2> __.as("sunshine").map(inE("followedBy").values("weight").mean()).as("avg_weight"), ......3> __.as("sunshine").inE("followedBy").as("x"), ......4> __.as("x").filter(values("weight").where(gte("avg_weight"))).outV().as("followers")). ......5> select("followers").by("name"); ==>LOOKS LIKE RAIN ==>PROMISED LAND ==>LIBERTY ==>EL PASO ==>PLAYING IN THE BAND ==>BIG RIVER ==>CASEY JONES ==>THE MUSIC NEVER STOPPED gremlin> ``` VOTE +1 You can merge this pull request into a Git repository by running: $ git pull https://github.com/apache/tinkerpop TINKERPOP-1762 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/tinkerpop/pull/701.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #701 ---- commit 651367be902a378a6d813ac39efac0bbc20561eb Author: Marko A. Rodriguez <okramma...@gmail.com> Date: 2017-08-29T21:46:32Z fixed a bug in match() where mid-clause where() variables were not being considered (only start where()s were). ---- > Make MatchStep analyze mid-clause variables for executing ordering purposes. > ---------------------------------------------------------------------------- > > Key: TINKERPOP-1762 > URL: https://issues.apache.org/jira/browse/TINKERPOP-1762 > Project: TinkerPop > Issue Type: Bug > Components: process > Affects Versions: 3.2.6 > Reporter: Marko A. Rodriguez > Assignee: Marko A. Rodriguez > > {code} > gremlin> graph = TinkerGraph.open() > ==>tinkergraph[vertices:0 edges:0] > gremlin> graph.io(graphml()).readGraph("data/grateful-dead.xml") > ==>null > gremlin> g = graph.traversal() > ==>graphtraversalsource[tinkergraph[vertices:808 edges:8049], standard] > gremlin> > gremlin> t = g.V().match( > ......1> __.as("sunshine").has("song", "name", "HERE COMES SUNSHINE"), > ......2> > __.as("sunshine").map(inE("followedBy").values("weight").mean()).as("avg_weight"), > ......3> __.as("sunshine").inE("followedBy").as("x"), > ......4> > __.as("x").filter(values("weight").where(gte("avg_weight"))).outV().as("followers") > ......5> ). > ......6> select("followers").by("name"); [] > gremlin> > gremlin> t.clone().limit(2) > ==>LOOKS LIKE RAIN > ==>PROMISED LAND > gremlin> t > Neither the sideEffects, map, nor path has a avg_weight-key: > WherePredicateStep(gte(avg_weight)) > Type ':help' or ':h' for help. > Display stack trace? [yN] > {code} -- This message was sent by Atlassian JIRA (v6.4.14#64029)