[ 
https://issues.apache.org/jira/browse/TINKERPOP-1090?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Daniel Kuppitz updated TINKERPOP-1090:
--------------------------------------
    Description: 
{noformat}
gremlin> g.inject(0L).as("id").V().has(id.getAccessor(), 
0L).iterate().toString()
==>[InjectStep([0])@[id], TinkerGraphStep(vertex,[~id.eq(0)])]
gremlin> g.inject(0L).as("id").V().has(id.getAccessor(), 
select("id")).iterate().toString()
==>[InjectStep([0])@[id], TinkerGraphStep([],vertex), 
TraversalFilterStep([PropertiesStep([~id],value), SelectOneStep(id)])]
gremlin> g.inject(0L).as("id").V().has(id, select("id")).iterate().toString()
==>[InjectStep([0])@[id], TinkerGraphStep(vertex,[~id.eq([SelectOneStep(id)])])]
{noformat}

The last compiled query is wrong, because we don't have a method overload for 
{{has(accessor, traversal)}}. The second one looks good and should return the 
same result as the first one, but its result is always empty.

{noformat}
gremlin> g.inject(0L).as("id").V().has(id.getAccessor(), 0L)
==>v[0]
gremlin> g.inject(0L).as("id").V().has(id.getAccessor(), select("id"))
gremlin> 
{noformat}

A (very) nice to have would be if the dynamic lookup would not result in a full 
graph scan.

  was:
{noformat}
gremlin> g.inject(0L).as("id").V().has(id.getAccessor(), 
0L).iterate().toString()
==>[InjectStep([0])@[id], TinkerGraphStep(vertex,[~id.eq(0)])]
gremlin> g.inject(0L).as("id").V().has(id.getAccessor(), 
select("id")).iterate().toString()
==>[InjectStep([0])@[id], TinkerGraphStep([],vertex), 
TraversalFilterStep([PropertiesStep([~id],value), SelectOneStep(id)])]
gremlin> g.inject(0L).as("id").V().has(id, select("id")).iterate().toString()
==>[InjectStep([0])@[id], TinkerGraphStep(vertex,[~id.eq([SelectOneStep(id)])])]
{noformat}

The last compiled query is wrong, because we don't have a method overload for 
{{has(accessor, traversal)}}. The second one looks good and should return the 
same result as the first one, but its result is always empty.

{noformat}
gremlin> g.inject(0L).as("id").V().has(id.getAccessor(), 0L)
==>v[0]
gremlin> g.inject(0L).as("id").V().has(id.getAccessor(), select("id"))
gremlin> 
{noformat}


> Dynamic vertex by id lookups
> ----------------------------
>
>                 Key: TINKERPOP-1090
>                 URL: https://issues.apache.org/jira/browse/TINKERPOP-1090
>             Project: TinkerPop
>          Issue Type: Improvement
>          Components: process
>    Affects Versions: 3.1.0-incubating
>            Reporter: Daniel Kuppitz
>
> {noformat}
> gremlin> g.inject(0L).as("id").V().has(id.getAccessor(), 
> 0L).iterate().toString()
> ==>[InjectStep([0])@[id], TinkerGraphStep(vertex,[~id.eq(0)])]
> gremlin> g.inject(0L).as("id").V().has(id.getAccessor(), 
> select("id")).iterate().toString()
> ==>[InjectStep([0])@[id], TinkerGraphStep([],vertex), 
> TraversalFilterStep([PropertiesStep([~id],value), SelectOneStep(id)])]
> gremlin> g.inject(0L).as("id").V().has(id, select("id")).iterate().toString()
> ==>[InjectStep([0])@[id], 
> TinkerGraphStep(vertex,[~id.eq([SelectOneStep(id)])])]
> {noformat}
> The last compiled query is wrong, because we don't have a method overload for 
> {{has(accessor, traversal)}}. The second one looks good and should return the 
> same result as the first one, but its result is always empty.
> {noformat}
> gremlin> g.inject(0L).as("id").V().has(id.getAccessor(), 0L)
> ==>v[0]
> gremlin> g.inject(0L).as("id").V().has(id.getAccessor(), select("id"))
> gremlin> 
> {noformat}
> A (very) nice to have would be if the dynamic lookup would not result in a 
> full graph scan.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to