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

Daniel Kuppitz commented on TINKERPOP-2220:
-------------------------------------------

{{dedup()}} is a {{FilterStep}}. Think about it, {{repeat(whatever).times(2)}} 
is supposed to emit whatever is left after the 2nd iteration. For 
{{repeat(dedup()).times(2)}} there's just nothing left in the stream as every 
element gets filtered in the 2nd iteration.

{code}
gremlin> g.V().repeat(dedup()).times(2).count()
==>0
gremlin> g.V().repeat(dedup()).emit().times(2).count()
==>6
{code}

If you emit all elements after each iteration, you'll get all the survivors 
from iteration 1. Does it make any more sense now?

It's not the same as {{dedup().dedup()}} as this only ensures uniqueness at two 
different steps in the traversal. And because it's not the same, 
{{RepeatUnrollStrategy}} won't do anything if it finds a {{DedupStep}}.

> Dedup inside Repeat Produces 0 results
> --------------------------------------
>
>                 Key: TINKERPOP-2220
>                 URL: https://issues.apache.org/jira/browse/TINKERPOP-2220
>             Project: TinkerPop
>          Issue Type: Bug
>          Components: process
>    Affects Versions: 3.3.0
>            Reporter: Rahul Chander
>            Priority: Major
>
> Testing against the Tinkerpop Modern graph dataset, I ran this query:
> {code:java}
> g.V().repeat(__.dedup()).times(2).count()
> {code}
> which should essentially be the same as running dedup twice. It produced 0 
> results, while dedup twice produced the correct 6.
>  
>  
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to