[
https://issues.apache.org/jira/browse/TINKERPOP-1867?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16317607#comment-16317607
]
Daniel Kuppitz commented on TINKERPOP-1867:
-------------------------------------------
It looks similar to what we saw in
[TINKERPOP-1629|https://issues.apache.org/jira/browse/TINKERPOP-1629].
{noformat}
gremlin> __.inject(1,2).map(union(fold()).fold())
==>[[1]]
==>[[],[2]]
gremlin> __.inject(1,2).map(union(mean()).fold())
==>[1.0]
==>[NaN,2.0]
{noformat}
Marko tried hard to solve TINKERPOP-1629, but ultimately we decided to allow
reducing barriers despite the few issues that can occur. It's probably the
same thing for {{union()}}. We could write a simple strategy though, that would
wrap all reducing child traversals in a {{map()}}.
{noformat}
gremlin> __.inject(1,2).map(union(map(fold())).fold())
==>[[1]]
==>[[2]]
gremlin> __.inject(1,2).map(union(map(mean())).fold())
==>[1.0]
==>[2.0]
{noformat}
> union() can produce extra traversers
> -------------------------------------
>
> Key: TINKERPOP-1867
> URL: https://issues.apache.org/jira/browse/TINKERPOP-1867
> Project: TinkerPop
> Issue Type: Bug
> Components: process
> Affects Versions: 3.2.7
> Reporter: stephen mallette
> Assignee: stephen mallette
>
> Hard to say where this bug is coming from but basically the most simple
> representation is:
> {code}
> gremlin> g.V(1,2).local(__.union(__.constant(1).count()))
> ==>1
> ==>0
> ==>1
> {code}
> Similar problems occur with {{sum()}} and other reducing barriers when used
> in this context.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)