[
https://issues.apache.org/jira/browse/TINKERPOP-1541?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15647657#comment-15647657
]
ASF GitHub Bot commented on TINKERPOP-1541:
-------------------------------------------
GitHub user okram opened a pull request:
https://github.com/apache/tinkerpop/pull/482
TINKERPOP-1541: Select should default to Pop.last semantics
https://issues.apache.org/jira/browse/TINKERPOP-1541
All `Scoping` steps use `Pop.last` semantics (`where()`, `match()`,
`dedup()`), except `select()` which uses `Pop.mixed`. This is a wart from
TinkerPop2 days. I changed `select()` to default to `Pop.last` and provided a
`selectV3d0()` backwards compatibility step (@spmallette -- is that how we
should name it? or is it `selectV3d2()` now?).
The benefit of this is that we can now introduce a simpler `Path` data
structure if a traversal is all `Path.last` (which is 99% of traversals out
there). That is, if the traversal requirements is `LABELED_PATH` and all pops
are `Pop.last`, then we don't need to store "historic" path elements and can
have a `MapPath` which is backed by a `Map<String,Object>`. Less data and a
simpler/faster equality test for bulking.
@robertdale --
```
gremlin> g.V(1).as('a').select(mixed,'a').as('a').select(mixed,'a')
==>[v[1],v[1]]
gremlin> g.V(1).as('a').select('a').as('a').select('a')
==>v[1]
```
VOTE +1.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/apache/tinkerpop TINKERPOP-1541
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/tinkerpop/pull/482.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 #482
----
commit 2d147bf8ef2c3f79a8015632c85a8a01a679f2fd
Author: Marko A. Rodriguez <[email protected]>
Date: 2016-11-08T14:01:19Z
Pop.mixed introduced to replace using a null Pop argument. SelectOneStep
and SelectStep now default to using Pop.last instead of Pop.mixed. All other
Scoping steps already use Pop.last semantics. This change will allow us to
introduce a simpler Path data structure for LABELED_PATH traversals with
complete Pop.last semantics (99 percent of uses).
----
> Select should default to Pop.last semantics
> -------------------------------------------
>
> Key: TINKERPOP-1541
> URL: https://issues.apache.org/jira/browse/TINKERPOP-1541
> Project: TinkerPop
> Issue Type: Improvement
> Components: process
> Affects Versions: 3.2.3
> Reporter: Marko A. Rodriguez
> Labels: breaking
>
> Check this out:
> {code}
> gremlin> g.V().as('a').select('a').as('a').select('a')
> ==>[v[1],v[1]]
> ==>[v[2],v[2]]
> ==>[v[3],v[3]]
> ==>[v[4],v[4]]
> ==>[v[5],v[5]]
> ==>[v[6],v[6]]
> {code}
> Shouldn't we just return the uniques? This is a big decision as this can
> cause massive rippling breakage for users :).
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)