Stephen Mallette created TINKERPOP-2627:
-------------------------------------------

             Summary: Use of union() in second by() to group()
                 Key: TINKERPOP-2627
                 URL: https://issues.apache.org/jira/browse/TINKERPOP-2627
             Project: TinkerPop
          Issue Type: Bug
          Components: process
    Affects Versions: 3.4.12
            Reporter: Stephen Mallette


Using air routes dataset, you get some odd output if you `union(...).fold()` in 
the second `by()` and if the children to `union()` are reducing steps:

{code}
gremlin> g.V().hasLabel('airport').has('country','TZ').
......1>   group().
......2>     by('country').
......3>     by(union(values('elev').min(), values('elev').max()).fold()).
......4>   unfold()
==>TZ=[3745, 3745, 2932, 2932, 3763, 3763, 371, 371, 5600, 5600, 4550, 4550, 
182, 182, 54, 54]
{code}

I was able to workaround it with:

{code}
gremlin> g.V().hasLabel('airport').has('country','TZ').
......1>   group().
......2>     by('country').
......3>     
by(values('elev').fold().local(union(min(local),max(local))).fold()).
......4>   unfold()
==>TZ=[54, 5600]
{code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to