[
https://issues.apache.org/jira/browse/TINKERPOP-2540?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Stephen Mallette closed TINKERPOP-2540.
---------------------------------------
Resolution: Not A Bug
Revisiting this, I think {{or()}} is working as expected. With infix notation
the rhs of the {{or()}} seems like it is meant to be carried all the way to the
end of the traversal (how would we know where to stop?) The infix notation is
perhaps better saved for use cases like the example in the reference
documentation as in:
{code}
gremlin> g.V().where(outE('created').or().outE('knows')).values('name')
==>marko
==>josh
==>peter
{code}
where it is embedded as a child to a filter in which case the "end of the
traversal" is an expected stopping point for the rhs of the {{or()}}.
> Unexpected count() step result
> ------------------------------
>
> Key: TINKERPOP-2540
> URL: https://issues.apache.org/jira/browse/TINKERPOP-2540
> Project: TinkerPop
> Issue Type: Bug
> Components: process, tinkergraph
> Affects Versions: 3.4.10
> Environment: OS: Ubuntu 20.04.2 LTS
> Java: Java(TM) SE Runtime Environment (build 1.8.0_241-b07)
> Reporter: Guobao Chen
> Priority: Major
>
> After installing latest (tinkerpop version 3.4.10), it's found that running a
> specific gremlin script with 'count()' step gives unexpected result.
> *Steps to reproduce*
> 1 Install tinkerpop 3.4.10, and connect to this server with gremlin console
> client
> 2 create a modern graph with TinkerFactory
> {code:java}
> gremlin> graph = TinkerFactory.createModern()
> ==>tinkergraph[vertices:6 edges:6]
> gremlin> g=graph.traversal()
> ==>graphtraversalsource[tinkergraph[vertices:6 edges:6], standard]
> gremlin> g
> ==>graphtraversalsource[tinkergraph[vertices:6 edges:6], standard]{code}
> 3 run following script:
> {code:java}
> gremlin>
> g.V().hasLabel('person').has('name','testuser1').or().has('name','testuser1').values('name','age').dedup().count()
> {code}
> Note that usser 'testuser1' doesn't exist in the created 'modern' graph.
> *Expected result*
> a numeric number showing the count (or 0 if there is no vertices from
> previous steps before count() step)
> *Actual result*
> See a list of vertices:
> {code:java}
> gremlin>
> g.V().hasLabel('person').has('name','testuser1').or().has('name','testuser1').values('name','age').dedup().count()
> ==>v[1]
> ==>v[2]
> ==>v[3]
> ==>v[4]
> ==>v[5]
> ==>v[6]{code}
--
This message was sent by Atlassian Jira
(v8.20.1#820001)