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

Side-effect group().by() can't handle user-defined maps

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.2.0-incubating
    • Fix Version/s: 3.2.4
    • Component/s: process
    • Labels:
      None

      Description

      Side-effect grouping is usually used to add things to an existing map. That no longer works as the group().by() expects all map values to be traversers. Check this:

      Normal grouping:

      gremlin> g = TinkerFactory.createModern().traversal()
      ==>graphtraversalsource[tinkergraph[vertices:6 edges:6], standard]
      gremlin> g.V().hasLabel("person").group().by("name").by(out("created").values("name").fold()).next()
      ==>peter=[lop]
      ==>vadas=[]
      ==>josh=[ripple, lop]
      ==>marko=[lop]
      

      Side-effect grouping:

      gremlin> m = ["marko":[]]
      ==>marko=[]
      gremlin> g.withSideEffect("m", m).V().hasLabel("person").group("m").by("name").by(out("created").values("name").fold()).cap("m")
      java.util.ArrayList cannot be cast to org.apache.tinkerpop.gremlin.process.traversal.Traversal$Admin
      Display stack trace? [yN] y
      java.lang.ClassCastException: java.util.ArrayList cannot be cast to org.apache.tinkerpop.gremlin.process.traversal.Traversal$Admin
      	at org.apache.tinkerpop.gremlin.process.traversal.step.map.GroupStep$GroupBiOperator.apply(GroupStep.java:217)
      	at org.apache.tinkerpop.gremlin.process.traversal.step.map.GroupStep$GroupBiOperator.apply(GroupStep.java:171)
      	at org.apache.tinkerpop.gremlin.process.traversal.util.DefaultTraversalSideEffects.add(DefaultTraversalSideEffects.java:92)
      	at org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.GroupSideEffectStep.sideEffect(GroupSideEffectStep.java:97)
      	at org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.SideEffectStep.processNextStart(SideEffectStep.java:39)
      	at org.apache.tinkerpop.gremlin.process.traversal.step.util.AbstractStep.hasNext(AbstractStep.java:140)
      	at org.apache.tinkerpop.gremlin.process.traversal.step.util.ExpandableStepIterator.hasNext(ExpandableStepIterator.java:42)
      	at org.apache.tinkerpop.gremlin.process.traversal.step.util.SupplyingBarrierStep.processAllStarts(SupplyingBarrierStep.java:83)
      	at org.apache.tinkerpop.gremlin.process.traversal.step.util.SupplyingBarrierStep.processNextStart(SupplyingBarrierStep.java:70)
      	at org.apache.tinkerpop.gremlin.process.traversal.step.util.AbstractStep.hasNext(AbstractStep.java:140)
      	at org.apache.tinkerpop.gremlin.process.traversal.util.DefaultTraversal.hasNext(DefaultTraversal.java:146)
      	at org.apache.tinkerpop.gremlin.console.Console$_closure3.doCall(Console.groovy:206)
      ...
      

        Attachments

          Activity

            People

            • Assignee:
              okram Marko A. Rodriguez
              Reporter:
              dkuppitz Daniel Kuppitz
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: