[
https://issues.apache.org/jira/browse/TINKERPOP-1629?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15876267#comment-15876267
]
Marko A. Rodriguez commented on TINKERPOP-1629:
-----------------------------------------------
By allowing the internal `fold()`, the results for your example traversal are
as follows.
{code}
// OLTP
gremlin>
g.V(1).repeat(aggregate("a").fold().store("x").unfold().both().where(without("a")).dedup()).cap("x").next()
==>[]
==>[v[1]]
==>[v[3],v[2],v[4]]
==>[v[6],v[5]]
// OLAP
gremlin>
g.withComputer().V(1).repeat(aggregate("a").fold().store("x").unfold().both().where(without("a")).dedup()).cap("x").next()
==>[v[1]]
==>[]
==>[]
==>[]
==>[]
==>[]
==>[v[3],v[2],v[4]]
==>[v[5],v[6]]
gremlin>
{code}
> Allow reducing barriers in repeat()
> -----------------------------------
>
> Key: TINKERPOP-1629
> URL: https://issues.apache.org/jira/browse/TINKERPOP-1629
> Project: TinkerPop
> Issue Type: Bug
> Components: process
> Affects Versions: 3.3.0
> Reporter: Daniel Kuppitz
> Assignee: Marko A. Rodriguez
>
> The following query transforms the modern graph into layers:
> {noformat}
> gremlin>
> g.V(1).aggregate("a").fold().store("x").unfold().both().where(without("a")).dedup().
> ......1>
> aggregate("a").fold().store("x").unfold().both().where(without("a")).dedup().
> ......2>
> aggregate("a").fold().store("x").unfold().both().where(without("a")).dedup().
> ......3> cap("x").next()
> ==>[v[1]]
> ==>[v[3],v[2],v[4]]
> ==>[v[6],v[5]]
> {noformat}
> The index of each list represents the minimum distance of the vertices it
> contains from {{v\[1]}}.
> There's obviously a lot of code duplication, but even worse: the max. depth
> has to be known upfront. {{repeat()}} could solve that, but currently fails
> if it contains a reducing barrier step (in OLTP and OLAP).
> {noformat}
> gremlin>
> g.V(1).repeat(aggregate("a").fold().store("x").unfold().both().where(without("a")).dedup()).cap("x").next()
> The parent of a reducing barrier can not be repeat()-step: FoldStep
> {noformat}
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)