[ 
https://issues.apache.org/jira/browse/TINKERPOP3-781?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14637908#comment-14637908
 ] 

Daniel Kuppitz commented on TINKERPOP3-781:
-------------------------------------------

[~okram] and I had this discussion a few times. You can make use of 
{{BarrierSteps}} using {{by()}}:

{code}
gremlin> g.V(1).as('a','b').select('a','b').by().by(both().fold())
==>[a:v[1], b:[v[3], v[2], v[4]]]
// or
gremlin> g.V(1).as('a').map(both().fold()).as('b').select('a','b')
==>[a:v[1], b:[v[3], v[2], v[4]]]
{code}

There are reasons why {{local()}} can/may not behave like this. [~okram] can 
probably tell you more, I always forget the *why*.

> Local aggregation should not destroy path
> -----------------------------------------
>
>                 Key: TINKERPOP3-781
>                 URL: https://issues.apache.org/jira/browse/TINKERPOP3-781
>             Project: TinkerPop 3
>          Issue Type: Improvement
>            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).as('a').local(both().fold()).as('b').select('a', 'b')
> ==>[b:[v[3], v[2], v[4]]]
> {noformat}
> It would be better if the preceding portion of the path (step "a" in the 
> example) were still retained.  Like so:
> {noformat}
> gremlin> g.V(1).as('a').local(both().fold()).as('b').select('a', 'b')
> ==>[a:v[1], b:[v[3], v[2], v[4]]]
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to