Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Label with schema filter on edge traversal fails #73

Closed
JPMoresmau opened this issue Sep 28, 2016 · 2 comments
Closed

Label with schema filter on edge traversal fails #73

JPMoresmau opened this issue Sep 28, 2016 · 2 comments

Comments

@JPMoresmau
Copy link
Collaborator

JPMoresmau commented Sep 28, 2016

The following test fails (postgresql 1.3.1-SNAPSHOT):

    Map<String,Object> keyValues=new HashMap<>();
    keyValues.put("name", "myname");

    String lbl1="myschema.mytype";
    Vertex v1=g.addVertex(lbl1, keyValues);

    String lbl2="myschema.mytype2";
    Vertex v2=g.addVertex(lbl2, keyValues);

    v1.addEdge("eee", v2);
    assertTrue("find edge :",g.traversal().V(v1.id()).out("eee").toList().contains(v2));
    assertTrue("find edge with name:",g.traversal().V(v1.id()).out("eee").has( "name", "myname").toList().contains(v2));
    assertTrue("find edge with schema.type and name:",g.traversal().V(v1.id()).out("eee").has(lbl2,  "name", "myname").toList().contains(v2));

The third assertion fails, while the first two succeed. Maybe linked to #65 , but here we're working inside the same schema.

@JPMoresmau
Copy link
Collaborator Author

OK, in SchemaTableTree, in removeObsoleteHasContainers and invalidateByHas we parse the predicate value for the label, and do not handle the fact that they could contain a dot (schema). I've added code to do that, I'll do a fork and a PR later. What I'm missing are the instructions to add tests and run them.

@pietermartin
Copy link
Owner

The test go in sql-test module.
Look around to see which package fits our test. Maybe in org.umlg.sqlg.test.edges
If you add a new test then add it to the AllTest suite. This will ensure it fires as part of mvn test

For local testing add it to AnyTest and run any of the concrete any tests.
PostgresAnyTest, HsqldbAnyTestorH2AnyTest`

Its not possible to run only one test, I generally just uncomment the other tests in a class to focus on only one test.

pietermartin added a commit that referenced this issue Sep 28, 2016
check if given label contain schema, fixes #73
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants