Uploaded image for project: 'TinkerPop'
  1. TinkerPop
  2. TINKERPOP-2627

Use of union() in second by() to group()

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 3.4.12
    • None
    • process
    • None

    Description

      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:

      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]
      

      I was able to workaround it with:

      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]
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            spmallette Stephen Mallette
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: