[ 
https://issues.apache.org/jira/browse/TINKERPOP-3121?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17933166#comment-17933166
 ] 

Andrea C edited comment on TINKERPOP-3121 at 4/3/25 9:14 PM:
-------------------------------------------------------------

GroupCountStep only has one `keyTraversal` which is essentially replaced when 
multiple `by()` modulators are used. In the given example the output is 
determined by the last `by()` modulator.

A fix could involve changing GroupCountStep to use a `TraversalRing` for its 
`keyTraversal`, essentially supporting multiple `by()` modulators instead of 
just one.

Another approach is to prevent multiple by operators by throwing an 
`IllegalStateException`.


was (Author: JIRAUSER308356):
GroupCountStep only has one `keyTraversal` which is essentially replaced when 
multiple `by()` modulators are used. In the given example the output is 
determined by the last `by()` modulator.

A fix could involve changing GroupCountStep to use a `TraversalRing` for its 
`keyTraversal`, essentially supporting multiple `by()` modulators instead of 
just one.

> Multiple by() modulators lead to unexpected behavior
> ----------------------------------------------------
>
>                 Key: TINKERPOP-3121
>                 URL: https://issues.apache.org/jira/browse/TINKERPOP-3121
>             Project: TinkerPop
>          Issue Type: Improvement
>          Components: process
>    Affects Versions: 3.6.7
>            Reporter: Stephen Mallette
>            Priority: Minor
>
> {code}
> gremlin> g.V().out().groupCount().by('lang')
> ==>[java:4]
> gremlin> g.V().out().groupCount().by('lang').by('age')
> ==>[32:1,27:1]
> gremlin> g.V().out().groupCount().by('age')
> ==>[32:1,27:1]
> gremlin> g.V().out().groupCount().by('lang').by('age').by('lang')
> ==>[java:4]
> {code}
> This might be an issue for other steps beyond {{groupCount()}}.



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

Reply via email to