You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tinkerpop.apache.org by "Anton (Jira)" <ji...@apache.org> on 2020/02/19 16:52:00 UTC
[jira] [Comment Edited] (TINKERPOP-2340) MatchStep with VertexStep
- Neither the sideEffects, map, nor path has a Y-key
[ https://issues.apache.org/jira/browse/TINKERPOP-2340?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17040206#comment-17040206 ]
Anton edited comment on TINKERPOP-2340 at 2/19/20 4:51 PM:
-----------------------------------------------------------
Interesting, if I am reading this right, it looks like the traversal *without* the extra dedup step rolled the filtering condition inside the match step:
{noformat}
... [MatchStartStep(X), WherePredicateStep(neq(Y)), MatchEndStep]]), SelectStep(last,[DEV_X, DEV_Y, SOFTWARE])]
{noformat}
whereas the traversal *with* the extra dedup step left the filtering condition outside as it was originally written:
{noformat}
..., WherePredicateStep(X,neq(Y)), DedupGlobalStep, SelectStep(last,[DEV_X, DEV_Y, SOFTWARE])]
{noformat}
The former is actually the form that I wanted to get working initially:
{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"),
__.as("X").where(P.neq("Y"))
).select("DEV_X", "DEV_Y", "SOFTWARE")
{noformat}
was (Author: arebgun):
Interesting, if I am reading this right, it looks like the traversal *without* the extra dedup step rolled the filtering condition inside the match step:
{noformat}
... [MatchStartStep(X), WherePredicateStep(neq(Y)), MatchEndStep]]), SelectStep(last,[DEV_X, DEV_Y, SOFTWARE])]
{noformat}
whereas the traversal *with* the extra dedup step left the filtering condition outside as it was originally written:
{noformat}
..., WherePredicateStep(X,neq(Y)), DedupGlobalStep, SelectStep(last,[DEV_X, DEV_Y, SOFTWARE])]
{noformat}
The latter is actually the form that I wanted to get working initially:
{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"),
__.as("X").where(P.neq("Y"))
).select("DEV_X", "DEV_Y", "SOFTWARE")
{noformat}
> 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
> Components: process
> Affects Versions: 3.4.5
> Environment: TinkerPop 3.4.5
> Reporter: Anton
> Priority: Major
>
> 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)