Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Invalid
-
3.2.5
-
None
-
None
Description
Without dedup():
gremlin> g.V().both().has("age").group("a").by("age").by(values("name").fold()).barrier().select("a").limit(1) ==>[32:[josh,josh,josh],35:[peter],27:[vadas],29:[marko,marko,marko]]
With dedup():
gremlin> g.V().both().has("age").group("a").by("age").by(values("name").dedup().fold()).barrier().select("a").limit(1) ==>[32:[josh:josh],35:[peter:peter],27:[vadas:vadas],29:[marko:marko]]
Why do the values end up being maps? That's pretty unexpected.
As a workaround we can do this:
gremlin> g.withSideEffect("a", [:].withDefault {[] as Set}).V().both().has("age").group("a").by("age").by(values("name").fold()).barrier().select("a").limit(1) ==>[27:[vadas],32:[josh],29:[marko],35:[peter]]
Also note, that cap() behaves correctly, even though we're using dedup():
gremlin> g.V().both().has("age").group("a").by("age").by(values("name").dedup().fold()).barrier().cap("a") ==>[32:[josh],35:[peter],27:[vadas],29:[marko]]