[
https://issues.apache.org/jira/browse/TINKERPOP3-670?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14546436#comment-14546436
]
ASF GitHub Bot commented on TINKERPOP3-670:
-------------------------------------------
GitHub user mhfrantz opened a pull request:
https://github.com/apache/incubator-tinkerpop/pull/65
TINKERPOP3-670 tail step doc
Also adds doc for `limit(local)` and `range(local)`, since they are related.
BTW, the documentation tool chain is really nice! I like being able to
write Groovy samples and have them executed during preprocessing.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/RedSeal-co/incubator-tinkerpop
TINKERPOP3-670-tail-step-doc
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/incubator-tinkerpop/pull/65.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #65
----
commit 12f854b8fbb636ec1e44ba514465ce61220f60f4
Author: mhfrantz <[email protected]>
Date: 2015-05-15T23:49:33Z
TINKERPOP3-670: Add doc for tail step
commit f96015136986434a3138af1b263221bd86d24050
Author: mhfrantz <[email protected]>
Date: 2015-05-16T00:05:30Z
Add limit(local) doc
commit 15899c7613307bbe123e8698cb5389f48e5ea192
Author: mhfrantz <[email protected]>
Date: 2015-05-16T00:24:54Z
Add range(local) doc
----
> tail step
> ---------
>
> Key: TINKERPOP3-670
> URL: https://issues.apache.org/jira/browse/TINKERPOP3-670
> Project: TinkerPop 3
> Issue Type: Improvement
> Components: process
> Reporter: Matt Frantz
>
> The tail step has two scopes:
> * global: emits the last N traversers that pass through it.
> * local: emits a {{List}} containing the last N elements of the inbound
> {{List}}
> Additionally, for {{tail(local, 1)}}, it emits a single element rather than a
> {{List}} containing a single element.
> TINKERPOP3-639 provides motivation.
> Scenario: Global scope
> {noformat}
> gremlin> g.V().order().by(T.id, incr).tail(global, 2)
> ==>v[5]
> ==>v[6]
> {noformat}
> Scenario: Default scope is global
> {noformat}
> gremlin> g.V().order().by(T.id, incr).tail(2)
> ==>v[5]
> ==>v[6]
> {noformat}
> Scenario: Local scope, {{List}} input, N>1
> {noformat}
> gremlin> g.V().as('a').out().as('a').out().as('a').select('a').tail(local, 2)
> ==>[v[4], v[5]]
> ==>[v[4], v[3]]
> {noformat}
> Scenario: Local scope, {{List}} input, N=1
> {noformat}
> gremlin> g.V().as('a').out().as('a').out().as('a').select('a').tail(local, 1)
> ==>v[5]
> ==>v[3]
> {noformat}
> Scenario: Local scope, {{Map}} input, N>1
> {noformat}
> gremlin> g.V().as('a').out().as('b').out().as('c').select().tail(local, 2)
> ==>[b:v[4], c:v[5]]
> ==>[b:v[4], c:v[3]]
> {noformat}
> Scenario: Local scope, {{Map}} input, N=1
> {noformat}
> gremlin> g.V().as('a').out().as('b').out().as('c').select().tail(local, 1)
> ==>[c:v[5]]
> ==>[c:v[3]]
> {noformat}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)