You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tinkerpop.apache.org by "Stephen Mallette (Jira)" <ji...@apache.org> on 2022/09/13 14:10:00 UTC

[jira] [Closed] (TINKERPOP-2795) Value modulator of the group step picks only a single element in some cases

     [ https://issues.apache.org/jira/browse/TINKERPOP-2795?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Stephen Mallette closed TINKERPOP-2795.
---------------------------------------
    Resolution: Not A Problem

This is expected behavior, though I can see why it appears to be wrong. A design decision was made to make {{by('name')}} a shorthand for {{by(values('name').fold())}} as that is most typical usage someone would attempt. your example that uses {{by(Traversal)}} is the more flexible version and falls back to the standard operation of {{by()}} where only the first item in the traversal is returned. You would therefore want to add your own reducer there to do {{by(valueMap('name').fold())}}.

> Value modulator of the group step picks only a single element in some cases
> ---------------------------------------------------------------------------
>
>                 Key: TINKERPOP-2795
>                 URL: https://issues.apache.org/jira/browse/TINKERPOP-2795
>             Project: TinkerPop
>          Issue Type: Bug
>          Components: process
>    Affects Versions: 3.6.0
>            Reporter: Pradyumna
>            Priority: Major
>
> As shown below, the value modulator of a group step ignores all but one record in some cases.
> gremlin> g = TinkerFactory.createModern().traversal();
> ==>graphtraversalsource[tinkergraph[vertices:6 edges:6], standard]
> gremlin> g.V().group().by('lang')
> ==>[java:[v[3],v[5]]]
> gremlin> g.V().group().by('lang').by('name')
> ==>[java:[lop,ripple]]
> gremlin> g.V().group().by('lang').by(valueMap('name'))
> ==>[java:[name:[ripple]]]
> gremlin>



--
This message was sent by Atlassian Jira
(v8.20.10#820010)