orientechnologies / orientdb-gremlin

TinkerPop3 Graph Structure Implementation for OrientDB
Apache License 2.0
91 stars 32 forks source link

hasId step fails #150

Open To-om opened 6 years ago

To-om commented 6 years ago

The gremlin step hasId fails with the error:

com.orientechnologies.orient.core.sql.OCommandSQLParsingException: Error parsing query:
SELECT FROM `V`  WHERE   `~id` = :~id

I've done the PR #149 to add unit tests.

wolf4ood commented 6 years ago

Hi @To-om

Thanks for the test cases. I've reproduces it and fixed I've integrated your tests in our test suite here

https://github.com/orientechnologies/orientdb-gremlin/commit/82dd280a2c7a08e104991aeda54cf9be480eed3d#diff-1494a2e455881effe25f767e3c12679bR160

The fix will be available in the next release 3.0.5 or in the next snapshot

To-om commented 6 years ago

Thank you for your quick fix. I confirm that it solve the parsing error. Unfortunately, I still have issue in my project. In the same transaction I do create a vertex using defined class (I used strict schema) then

Vertex v = graph.traversal().V(createdVertex.id()).next();
graph.traversal().V().hasId(createdVertex.id()).next(); // fails

I have not yet succeeded in reproducing the problem in an unit test.

wolf4ood commented 5 years ago

Hi @To-om

which error do you get on the second issue?

To-om commented 5 years ago

The vertex is not found

To-om commented 5 years ago

I've just reproduced the error in an unit test. The test hasIdWithString is not correctly named as ID is not a string but an object. If you stringify it, the test fails. Assert.assertEquals(1, graph.traversal().V().hasId(v1.id()).toList().size()); : PASS Assert.assertEquals(1, graph.traversal().V().hasId(v1.id().toString()).toList().size()); : FAIL