[
https://issues.apache.org/jira/browse/TINKERPOP-1626?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15878731#comment-15878731
]
ASF GitHub Bot commented on TINKERPOP-1626:
-------------------------------------------
GitHub user okram opened a pull request:
https://github.com/apache/tinkerpop/pull/562
TINKERPOP-1626: choose() is buggy in OLAP
https://issues.apache.org/jira/browse/TINKERPOP-1626
`ComputerAwareStep.EndStep` was using `path.extend()` and not
`traverser.addLabel()` to append step labels in OLAP and thus, the step label
data wasn't being recorded because `path.extend()` is an immutable operation.
Also, updated `PathRetractionStrategy` to look like `LazyBarrierStrategy's`
recent tweaks to not add a barrier to the end of a traversal -- leave that up
to `RemoteStrategy`.
VOTE +1.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/apache/tinkerpop TINKERPOP-1626
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/tinkerpop/pull/562.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 #562
----
commit 012edf17531f5b4ce979351bdfde504a32437800
Author: Marko A. Rodriguez <[email protected]>
Date: 2017-02-22T16:59:09Z
fixed a bug in OLAP ComputerAwareStep.EndStep where labels were not being
appended to the traverser correctly. Also, a small optimization tweak to
PathRetractionStrategy to mirror the barrier-optimization retraction that was
done earlier on tp32/ around LazyBarrierStrategy.
----
> 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
> Assignee: Marko A. Rodriguez
>
> 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)