[
https://issues.apache.org/jira/browse/TINKERPOP3-781?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14638155#comment-14638155
]
Matt Frantz commented on TINKERPOP3-781:
----------------------------------------
To answer my own question (by hacking this change in and watching tests fail),
it doesn't work because {{flatMap(Traversal)}} does not extend the path based
on the child traversal. The following test fails when {{local}} is implemented
with {{TraversalFlatMapStep}}:
{noformat}
gremlin> g.V().has(T.label,
"person").as("a").local(out("created").as("b")).select("a",
"b").by("name").by(T.id)
==>[a:marko, b:3]
==>[a:josh, b:5]
==>[a:josh, b:3]
==>[a:peter, b:3]
{noformat}
So it seems we have the choice between {{local}}, which can forget the path
prior (for a reducing barrier step), and {{flatMap(Traversal)}} which forgets
the child path.
> Local aggregation should not destroy path
> -----------------------------------------
>
> Key: TINKERPOP3-781
> URL: https://issues.apache.org/jira/browse/TINKERPOP3-781
> Project: TinkerPop 3
> Issue Type: Improvement
> Components: process
> Reporter: Matt Frantz
>
> Currently, if we do an aggregating step (e.g. {{fold}}, {{groupCount}}, etc.)
> within the {{local}} step, we lose the path information.
> {noformat}
> gremlin> g.V(1).local(both().fold()).path()
> ==>[[v[3], v[2], v[4]]]
> {noformat}
> It would be better if the preceding portion of the path were still retained
> like so:
> {noformat}
> gremlin> g.V(1).local(both().fold()).path()
> ==>[v[1], [v[3], v[2], v[4]]]
> {noformat}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)