You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tinkerpop.apache.org by "Daniel Kuppitz (JIRA)" <ji...@apache.org> on 2017/05/28 13:40:04 UTC

[jira] [Commented] (TINKERPOP-1681) Multiple hasId's are or'd into GraphStep

    [ https://issues.apache.org/jira/browse/TINKERPOP-1681?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16027825#comment-16027825 ] 

Daniel Kuppitz commented on TINKERPOP-1681:
-------------------------------------------

I have a fix locally (the only folds the first set of ids into GraphStep), but I wonder if we should be smarter. We could take the intersection of multiple {{hasId}}'s, so that

{noformat}
g.V().hasId(within(1,2)).hasId(within(2,3))
{noformat}

... becomes:

{noformat}
g.V().hasId(2) // or g.V().hasId(within(2))
{noformat}

But what if the intersection is empty?

{noformat}
g.V().hasId(within(1,2)).hasId(3)
{noformat}

... could be converted into something like this:

{noformat}
g.V().not(identity())
{noformat}

However, that turns the query into a full-scan query, which is not acceptable IMO. Other suggestions?

> Multiple hasId's are or'd into GraphStep
> ----------------------------------------
>
>                 Key: TINKERPOP-1681
>                 URL: https://issues.apache.org/jira/browse/TINKERPOP-1681
>             Project: TinkerPop
>          Issue Type: Bug
>          Components: process
>    Affects Versions: 3.2.4
>            Reporter: Daniel Kuppitz
>            Assignee: Daniel Kuppitz
>
> From the dev mailing list:
> {noformat}
>     @Test
>     public void testHasId() {
>         final TinkerGraph graph = TinkerGraph.open();
>         Vertex a = graph.addVertex(T.label, "A");
>         Vertex b = graph.addVertex(T.label, "B");
>         List<Vertex> vertices = graph.traversal().V().hasId(a.id()).hasId(b.id()).toList();
>         Assert.assertTrue(vertices.isEmpty());
>     }
> {noformat}
> The test fails as the both vertices are returned.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)