[
https://issues.apache.org/jira/browse/TINKERPOP-2674?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17464805#comment-17464805
]
Fredrick Eisele commented on TINKERPOP-2674:
--------------------------------------------
Work around:
Replace the `as('a')...select('a')` with `sideEffect`.
{code:groovy}
g.V().
has('[avm]Design', 'uuid', 'SRC_UUID').
sideEffect(...).
repeat(__.in('inside').simplePath()).
emit().
until(__.in('inside').count().is(0)).
toList()
{code}
> `as('a')` step followed by `select('a')` not behaving as expected
> -----------------------------------------------------------------
>
> Key: TINKERPOP-2674
> URL: https://issues.apache.org/jira/browse/TINKERPOP-2674
> Project: TinkerPop
> Issue Type: Bug
> Components: tinkergraph
> Affects Versions: 3.5.1
> Reporter: Fredrick Eisele
> Priority: Major
>
> The inclusion of the `select()` step changes the result when it should not.
> Steps to replicate.
> Given a graph:
> ```groovy
> g.addV('[avm]Design').as('root').
> property('VertexLabel','[avm]Design').
> property('uuid','SRC_UUID').
> property('[]Name', 'Axe').
> addV('[]RootContainer').as('rc').
> property('VertexLabel','[]RootContainer').
> property('[]Name','Axe').
> addV('[]Property').as('p1').
> property('VertexLabel','[]Property').
> property('[]XPosition','56').
> addV('[]Value').as('v1').
> property('VertexLabel','[]Value').
> property('[]stuff','12').
> addV('[]Property').as('p2').
> property('VertexLabel','[]Property').
> property('[]XPosition','80').
> addV('[]Value').as('v2').
> property('VertexLabel','[]Value').
> property('[]stuff','90').
> addE('inside').from('rc').to('root').
> addE('inside').from('p1').to('rc').
> addE('inside').from('v1').to('p1').
> addE('inside').from('p2').to('rc').
> addE('inside').from('v2').to('p2').
> iterate()
> ```
> The following two queries produce different results.
> This first query produces a list of all the vertices with the exception of
> 'r0'.
> ```groovy
> g.V().
> has('[avm]Design', 'uuid', 'SRC_UUID').as('r0').
> repeat(__.in('inside').simplePath()).
> emit().
> until(__.in('inside').count().is(0)).
> toList()
> ```
> The addition of the `select('r0')` step in this query causes no vertices to
> be returned.
> ```groovy
> g.V().
> has('[avm]Design', 'uuid', 'SRC_UUID').as('r0').
> select('r0').
> repeat(__.in('inside').simplePath()).
> emit().
> until(__.in('inside').count().is(0)).
> toList()
> ```
--
This message was sent by Atlassian Jira
(v8.20.1#820001)