[
https://issues.apache.org/jira/browse/TINKERPOP3-673?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14573442#comment-14573442
]
ASF GitHub Bot commented on TINKERPOP3-673:
-------------------------------------------
GitHub user mhfrantz opened a pull request:
https://github.com/apache/incubator-tinkerpop/pull/69
TINKERPOP3-673: range/limit local with single element should eschew List
This PR makes range, limit, and tail more consistent.
tinkergraph-gremlin tests pass
hadoop-gremlin tests pass
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/RedSeal-co/incubator-tinkerpop
chore/TP3-limit-local-1-should-emit-element_96105186
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/incubator-tinkerpop/pull/69.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 #69
----
commit c26b87ce8c763f5d9cdcb735078b685a0af85b82
Author: mhfrantz <[email protected]>
Date: 2015-06-04T19:02:31Z
Refactor RangeLocalStep.applyRange for readability
commit fd3a6c9f42106b666d65688ec52281a29f2bfc46
Author: mhfrantz <[email protected]>
Date: 2015-06-04T19:19:09Z
TINKERPOP3-673: limit/range local single element eschews List
----
> limit(local, 1) should emit element, not List
> ---------------------------------------------
>
> Key: TINKERPOP3-673
> URL: https://issues.apache.org/jira/browse/TINKERPOP3-673
> Project: TinkerPop 3
> Issue Type: Improvement
> Components: process
> Reporter: Matt Frantz
>
> The philosophy of the TP3 API is "containers only when necessary". There is
> a tendency to eschew the container when its size would be one.
> For example, {{select("foo")}} will not emit a {{Map}} with a single
> key/value, but instead will emit a single value. Similarly, if any
> {{select}} of a step label finds only a single instance of that step in the
> path, it will emit the value at that step; only if multiple steps in the path
> have the same label will a {{List}} be created.
> In that spirit, {{limit(local, 1)}} should emit an element, rather than a
> one-element {{List}}.
> This would also mean that {{range(local)}} operating on a {{List}} would emit
> a single element if the number of elements is selected by the range is 1.
> This would also reconcile the behavior with the {{tail}} step.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)