Anton created TINKERPOP-2340: -------------------------------- Summary: MatchStep with VertexStep - Neither the sideEffects, map, nor path has a Y-key Key: TINKERPOP-2340 URL: https://issues.apache.org/jira/browse/TINKERPOP-2340 Project: TinkerPop Issue Type: Bug Affects Versions: 3.4.5 Environment: TinkerPop 3.4.5 Reporter: Anton
Using Tinkerpop Modern graph, find all pairs of people who worked on software with the same name, filtering out pairs that would bind X and Y to the same person, using MATCH traversal: {noformat} g.V().match( __.as("X").out("created").as("Z"), __.as("X").V().as("Y").out("created").as("V"), __.as("Z").values("name").as("SOFTWARE"), __.as("V").values("name").as("SOFTWARE"), __.as("X").values("name").as("DEV_X"), __.as("Y").values("name").as("DEV_Y") ).where("X", P.neq("Y")) .select("DEV_X", "DEV_Y", "SOFTWARE") {noformat} The above fails with: {noformat} java.lang.IllegalArgumentException: Neither the sideEffects, map, nor path has a Y-key: WherePredicateStep(neq(Y)) at org.apache.tinkerpop.gremlin.process.traversal.step.Scoping.getScopeValue(Scoping.java:124) at org.apache.tinkerpop.gremlin.process.traversal.step.filter.WherePredicateStep.setPredicateValues(WherePredicateStep.java:82) at org.apache.tinkerpop.gremlin.process.traversal.step.filter.WherePredicateStep.filter(WherePredicateStep.java:103) at org.apache.tinkerpop.gremlin.process.traversal.step.filter.FilterStep.processNextStart(FilterStep.java:38) at org.apache.tinkerpop.gremlin.process.traversal.step.filter.WherePredicateStep.processNextStart(WherePredicateStep.java:150) at org.apache.tinkerpop.gremlin.process.traversal.step.util.AbstractStep.hasNext(AbstractStep.java:143) at org.apache.tinkerpop.gremlin.process.traversal.step.util.ExpandableStepIterator.next(ExpandableStepIterator.java:50) at org.apache.tinkerpop.gremlin.process.traversal.step.map.MatchStep$MatchEndStep.processNextStart(MatchStep.java:569) at org.apache.tinkerpop.gremlin.process.traversal.step.util.AbstractStep.hasNext(AbstractStep.java:143) at org.apache.tinkerpop.gremlin.process.traversal.util.DefaultTraversal.hasNext(DefaultTraversal.java:197) at org.apache.tinkerpop.gremlin.process.traversal.step.map.MatchStep.standardAlgorithm(MatchStep.java:371) at org.apache.tinkerpop.gremlin.process.traversal.step.util.ComputerAwareStep.processNextStart(ComputerAwareStep.java:46) at org.apache.tinkerpop.gremlin.process.traversal.step.util.AbstractStep.hasNext(AbstractStep.java:143) at org.apache.tinkerpop.gremlin.process.traversal.step.util.ExpandableStepIterator.next(ExpandableStepIterator.java:50) at org.apache.tinkerpop.gremlin.process.traversal.step.map.MapStep.processNextStart(MapStep.java:36) at org.apache.tinkerpop.gremlin.process.traversal.step.map.SelectStep.processNextStart(SelectStep.java:156) at org.apache.tinkerpop.gremlin.process.traversal.step.util.AbstractStep.next(AbstractStep.java:128) at org.apache.tinkerpop.gremlin.process.traversal.step.util.AbstractStep.next(AbstractStep.java:38) at org.apache.tinkerpop.gremlin.process.traversal.Traversal.fill(Traversal.java:181) at org.apache.tinkerpop.gremlin.process.traversal.Traversal.toList(Traversal.java:119) {noformat} Adding an extra dedup() step makes it work: {noformat} g.V().match( __.as("X").out("created").as("Z"), __.as("X").V().as("Y").out("created").as("V"), __.as("Z").values("name").as("SOFTWARE"), __.as("V").values("name").as("SOFTWARE"), __.as("X").values("name").as("DEV_X"), __.as("Y").values("name").as("DEV_Y") ).dedup().where("X", P.neq("Y")) .select("DEV_X", "DEV_Y", "SOFTWARE") {noformat} returns: {noformat} {DEV_X=marko, DEV_Y=josh, SOFTWARE=lop} {DEV_X=marko, DEV_Y=peter, SOFTWARE=lop} {DEV_X=josh, DEV_Y=marko, SOFTWARE=lop} {DEV_X=josh, DEV_Y=peter, SOFTWARE=lop} {DEV_X=peter, DEV_Y=marko, SOFTWARE=lop} {DEV_X=peter, DEV_Y=josh, SOFTWARE=lop} {noformat} This seems to be related to TINKERPOP-1762. -- This message was sent by Atlassian Jira (v8.3.4#803005)