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

ASF GitHub Bot commented on TINKERPOP-3150:
-------------------------------------------

EchoNullify opened a new pull request, #3093:
URL: https://github.com/apache/tinkerpop/pull/3093

   TARGET  3.8-dev
   
   https://issues.apache.org/jira/browse/TINKERPOP-3150
   
   Prevent multiple by operators from being used for sample step  by throwing 
IllegalStateException if modulateBy is called more than once.




> Prevent sample step from having multiple by modulators
> ------------------------------------------------------
>
>                 Key: TINKERPOP-3150
>                 URL: https://issues.apache.org/jira/browse/TINKERPOP-3150
>             Project: TinkerPop
>          Issue Type: Improvement
>          Components: process
>    Affects Versions: 3.7.3
>            Reporter: Andrea C
>            Priority: Minor
>
> Sample step will ignore previous by modulators if multiple are specified, 
> which can be misleading to the user. Instead, similar to 
> https://issues.apache.org/jira/browse/TINKERPOP-3121 multiple by modulators 
> should be prevented with sample.
> {code:java}
> gremlin> g.V().sample(10).by(id).elementMap()
> ==>[id:1,label:person,name:marko,age:29]
> ==>[id:2,label:person,name:vadas,age:27]
> ==>[id:3,label:software,name:lop,lang:java]
> ==>[id:4,label:person,name:josh,age:32]
> ==>[id:5,label:software,name:ripple,lang:java]
> ==>[id:6,label:person,name:peter,age:35]
> gremlin> g.V().sample(10).by('age').elementMap()
> ==>[id:1,label:person,name:marko,age:29]
> ==>[id:2,label:person,name:vadas,age:27]
> ==>[id:4,label:person,name:josh,age:32]
> ==>[id:6,label:person,name:peter,age:35]
> gremlin> g.V().sample(10).by('age').by(id).elementMap()
> ==>[id:1,label:person,name:marko,age:29]
> ==>[id:2,label:person,name:vadas,age:27]
> ==>[id:3,label:software,name:lop,lang:java]
> ==>[id:4,label:person,name:josh,age:32]
> ==>[id:5,label:software,name:ripple,lang:java]
> ==>[id:6,label:person,name:peter,age:35]{code}



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

Reply via email to